Home › Forums › JavaScript › thumbnails won't enlarge in same window › Reply To: thumbnails won't enlarge in same window
January 6, 2015 at 1:57 pm
#192424
Participant
this is the script. i put it at bottom of the slew of images.
$(document).ready(function() {
var imageLinks = $('a[href$=".png"], a[href$=".jpg"], a[href$=".gif"], a[href$=".bmp"]');
if (imageLinks.children('boxInner').length) {
imageLinks.children('boxInner').each(function() {
var currentTitle = $(this).attr('title');
$(this).attr('title', currentTitle + ' (click to enlarge image)');
});
imageLinks.click(function(e) {
e.preventDefault();
$(this).children('boxInner').toggleClass('expanded');
});
}
});