I need that when I click in anything that uses fancybox it generates a specific URL for that, so when I send this link to someone, it opens the specific box I want.
For example:
fancybox.net/home
when I click in the first image, the link still fancybox.net/home
I want that when I click in the image, the URL is generated and appears in address bar like: fancybox.net/home/imageid=1
so when i send fancybox.net/home/imageid=1 to someone it already opens the image in the box
Thanks!
(It is like facebook photos, when you click in any photo, the photo opens in a box but the address bar changes to the image link)
//////
UPDATE #1
//////
I did what JFK suggested but after one hour trying i still don't know why the boxes aren't the same.
Look the diference between:
the code:
<script type="text/javascript">
var thisHash = window.location.hash;
$(document).ready(function() {
if(window.location.hash) {
$(thisHash).fancybox({
prevEffect : 'none',
nextEffect : 'none',
closeBtn : false,
arrows : true,
nextClick : true,
helpers : {
thumbs : {
width : 80,
height : 80
},
title : {
type : 'inside'
},
buttons : {}
},
afterLoad : function() {
this.title = (this.index + 1) + ' de ' + this.group.length + '<div id="curti"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.google.com.br&send=true&layout=standard&width=45&show_faces=false&action=like&colorscheme=light&font&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:56px; height:24px;" allowTransparency="true"></iframe></div>';
}
}).trigger('click');
}
$('.fancylink').fancybox({
prevEffect : 'none',
nextEffect : 'none',
closeBtn : false,
arrows : true,
nextClick : true,
helpers : {
thumbs : {
width : 80,
height : 80
},
title : {
type : 'inside'
},
buttons : {}
},
afterLoad : function() {
this.title = (this.index + 1) + ' de ' + this.group.length + '<div id="curti"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.google.com.br&send=true&layout=standard&width=45&show_faces=false&action=like&colorscheme=light&font&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:56px; height:24px;" allowTransparency="true"></iframe></div>';
}
});
}); // ready
</script>
What's wrong in that script?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…