Skip to content Skip to sidebar Skip to footer

How To Use Jquery .html() For Fancybox Content

my file: $(this) inside the fancybox (v1.3.x) function (it's a design issue), but inside any other jQuery method so try this

$(document).ready(function(){
 $(".image a").bind("click",function (){
  var data = $(this).parent().html();
  var dataTitle = $(this).attr("alt");
  function newTitle(){return "<span>"+dataTitle+"</span>";}
  $.fancybox(data,{
   "titlePosition": "inside",
   "titleFormat": newTitle
  }); // fancybox
  return false;
 }); // bind
}); //ready

Solution 2:

I think this one will work:

   $(".image a").click(function (){
       $.fancybox($(this).parent().html(),{
           title: $(this).attr("alt")
       });
   });

Post a Comment for "How To Use Jquery .html() For Fancybox Content"