我在使用二十二岁儿童主题制作的wordpress网站中使用了花式框2。我需要它,当你将鼠标悬停在图像上时,它会显示人名,当你点击图像时,它会有几段描述。除了悬停部分之外,我有一切工作,当你悬停时它显示整个大描述。单独悬停在fancybox中的图像描述2
Here is a link to the page.(密码是boogiebop)
这里是JavaScript:
jQuery(document).ready(function() {
jQuery(".fancybox").fancybox({
beforeshow: function(){
this.title = $(this.element).next('.newTitle').html();
},
helpers: {
title : {
type : 'inside'
}
}
}); // fancybox
}); // ready
我曾尝试添加此:
<a class="fancybox" href="images/01.jpg" title="only show this on hover"><img src="images/01t.jpg" /></a>
<div class="newTitle" style="display: none;"><p>hello, visite my site <a href="http://fancyapps.com/fancybox/">http://fancyapps.com/fancybox/</a></p></div>
但无济于事我得到的是标准标题。
它不适合你的原因是因为回调的名称不是'beforeshow',而是'beforeShow'(它使用[CamelCase](http://en.wikipedia.org/wiki/CamelCase)格式) ...查看更多http://stackoverflow.com/a/9611664/1055987 – JFK 2013-04-30 18:20:27