将onclick新窗口转换为onclick奇形框?
我得到了这个显示facebook照片的免费代码,它很棒,但它打开了一个新窗口,并没有真正做到这一点,想把它转换为打开一个fancybox,而不是任何帮助感谢。
完整url = http://www.footfalldigital.co.uk/fbalbum.html
提前谢谢李:“总有一天我会请你喝一品脱的。”
<script language="javascript" type="text/javascript">
function popitup(url) {
newwindow=window.open(url,'name','height=450,width=600,location=1,toolbar=1,status=1,resizable=1')
if (window.focus) {newwindow.focus()}
return false;
}
</script>
<script type="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
<!-------ENTER YOUR FACEBOOK ALBUM IDS HERE------->
var id1 = "444691594416";
var id2 = "";
var id3 = "";
var id4 = "";
var id5 = "";
<!----------------------------------------------->
function fbFetch1(){
var url = "https://graph.facebook.com/" + id1 + "/photos&callback=?&limit=0";
$.getJSON(url,function(json){
var html = "";
$.each(json.data,function(i,fb){
var name = "";
if (fb.name !== undefined){
var name = fb.name;}
html += "<a onclick=\"return popitup('" + fb.source + "')\"><img style='margin:5px;padding:0px;cursor:pointer;vertical-align:middle;' src=" + fb.picture + " title=\"" + name + "\"></a>"; });
html += "";
$('.facebookfeed1').animate({opacity:0}, 500, function(){
$('.facebookfeed1').html(html);});
$('.facebookfeed1').animate({opacity:1}, 500);}
);
};
function fbFetch2(){发布于 2012-07-19 18:09:45
如果你已经有了页面上的所有图片,为什么不看看:http://lokeshdhakar.com/projects/lightbox/会自动查看选择器中的图片,并为你添加相册。
取自他们网站的:
How to Use:
Include lightbox.js in your header.
<script type="text/javascript" src="lightbox.js"></script>
Add rel="lightbox" attribute to any link tag to activate the lightbox. For example:
<a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a>
Optional: Use the title attribute if you want to show a caption.更新
http://lokeshdhakar.com/projects/lightbox2/ - Updated version
Replace:
$('.facebookfeed5').animate({opacity:0}, 500, function(){
$('.facebookfeed5').html(html);});
$('.facebookfeed5').animate({opacity:1}, 500);});};
With:
$('.facebookfeed5').animate({opacity:0}, 500, function(){
$('.facebookfeed5').html(html);});
$('.facebookfeed5').animate({opacity:1}, 500);})
$('img').attr('rel','lightbox')
;};https://stackoverflow.com/questions/11558478
复制相似问题