Tell me more ×  I have a simple jquery image gallery. When a
user clicks on thumb it will replace ‘thumb’ to ‘large’ in src
attribute of the main Image, I use delegate method of jQuery to
dynamically load thumbs and use them without bind event
listeners for new thumbs. jsfiddle  Now i need to be able to
link to a specific image in the gallery, For example, so the
user will immediately see the 3rd image in the gallery,
something like the method that engadget is using  Thanks for any
help.  share|improve this question add comment  1 Answer  up
vote 2 down vote accepted  Simply grab the page's hash value and
use it as an index against the set of thumbs:  wlh =
window.location.hash[1]; if (!isNaN(wlh)) {
$('#largeImage').attr('src', $('#thumbs
img').eq(wlh-1).attr('src').replace('thumb', 'large'));  Demo:
(will initially show the 3rd image)  To add a hash to the URL
while browsing images so the URL is primed for sharing a certain
image, it's just an extra line after changing the #largeImage:
window.location.