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.
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
Post a Comment