使用fancybox中的标题在单独的窗口中打开另一个链接 [英] Use title in fancybox to open up another link in a separate window
本文介绍了使用fancybox中的标题在单独的窗口中打开另一个链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
全部,我有以下代码显示一组Instagram照片,然后我在我的网站上用fancybox打开它们:
$ output。='< script type = < span class =code-keyword> text / javascript >
jQuery(document).ready(function($){
$(。fancybox)。fancybox();
});
< / script > 跨度>';
$ output。='< div id = bd -instagram > ';
for($ i = 0; $ i < $ count; $ i ++){
$ output 。 =' < div class = BD-Instagram的项目 >
< a rel =instagram-widgetclass =fancyboxtitle =这是一个标题href =' 。$ images [$ i] ['image_large']。' >
< img src = '。$ images [$ i] ['image_small']。' alt = > < / a >
< / div > ';
}
fancybox打开并在图像下方显示标题This is a title。但是我真的想把它作为一个链接,以便当有人点击标题时它会打开一个链接。我试图做这样的事情:
< a rel =instagram-widgetclass =fancyboxtitle =< ; a href =http://www.instagram.com>测试< / a> href =''。$ images [$ i] [''image_large'']。''>
没有虽然不起作用,但在我的页面上产生了一些奇怪的HTML。有没有人知道如何做这样的事情?
解决方案
output。='< script type = text / javascript >
jQuery (document).ready(function(
){
(。fancybox)。fancybox();
});
< / script > 跨度>';
All, I''ve got the following code to display a group of instagram photos and then I open them on my site with fancybox:
$output .= '<script type="text/javascript">
jQuery(document).ready(function($) {
$(".fancybox").fancybox();
});
</script>';
$output .= '<div id="bd-instagram">';
for($i=0; $i<$count; $i++){
$output .= '<div class="bd-instagram-item">
<a rel="instagram-widget" class="fancybox" title="This is a title" href="'.$images[$i]['image_large'].'">
<img src="'.$images[$i]['image_small'].'" alt=""></a>
</div>';
}
The fancybox opens up and displays the title "This is a title" underneath the image. However I''d actually like to make this a link so that when someone clicks on the title it opens up a link. I was trying to do something like this:
<a rel="instagram-widget" class="fancybox" title="<a href="http://www.instagram.com">Testing</a>" href="''.$images[$i][''image_large''].''">
That doesn''t work though and produces some odd HTML on my page. Does anyone have any idea on how to do something like that this?
解决方案
output .= '<script type="text/javascript"> jQuery(document).ready(function(
) {
(".fancybox").fancybox(); }); </script>';
这篇关于使用fancybox中的标题在单独的窗口中打开另一个链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文