티스토리에 이미지 플러그인 LIghtbox, fancybox 적용하기

• etc/• blog tip & utill / 2015. 7. 8. 09:52

<!------------------------ fancybox start ----------------------------->
<!-- Add jQuery library -->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<!-- Add fancyBox main JS and CSS files -->
<script type="text/javascript" src="./images/jquery.fancybox.pack.js?v=2.1.5"></script>
<link rel="stylesheet" type="text/css" href="./images/jquery.fancybox.css?v=2.1.5" media="screen" />
<script>
$(document).ready(function(){
 $(".imageblock").each( function(){
  var img = $(this).find('img');
  $(img).wrap("<a class='fancybox' href='#'/>").closest("a")
  .on("click", function( event){
      event.stopPropagation();
   event.preventDefault();
   $.fancybox.open( $(this).html());
  });
 });
});
</script>
<!------------------------ fancybox end ----------------------------->





위로가기

POWERED BY TISTORY. THEME BY HE+STORY