javascript - jQuery thumbnail script edit -


i created script takes full size image , makes thumbnail out of it. problem is, if link image breaks script. i've tried has failed. can check out jsfiddle , notice first thumbnail works second 1 not (because it's linked). getting straightened out appreciated.

to clarify, thumbnails linked, don't need script work on first thumbnail in example. need work on second (linked) thumbnail.

http://jsfiddle.net/ussmy/

at end of code try call

 fitimages( $('.titled-thumb img') ) 

since wrote fitimages($('.titled-thumb > img')) > immediate descendant selector if link images, you're placing intermediate element selector cannot work anymore.

if remove selector fiddle see images (your fiddle updated)

update: same reason change

parent = img.parent(), 

with

parent = img.closest('div'), 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -