I need that when clicking on something using fancybox, it will generate a specific URL for it, so when I send this link to someone, it opens the specific field that I want.
For example: fancybox.net/home when I click on the first image, the link is still fancybox.net/home I want the URL to be created and displayed in the address bar when I click on the image, for example: fancybox.net/home/imageid = 1 therefore, when I send fancybox.net/home/imageid=1 to someone, it already opens the image in the field
Thanks!
(It's like a facebook photo, when you click on any photo, the photo opens in the field, but the address bar changes the link to the image)
////// UPDATE # 1 //////
I did what JFK suggested, but after one hour of trying, I still don't know why the boxes do not match.
See the difference 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>'; } }); }); </script>
What is wrong with this script?
jquery hyperlink fancybox
Artur haddad
source share