Created
May 3, 2012 17:05
-
-
Save clivewalkden/2587292 to your computer and use it in GitHub Desktop.
gallery code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
var largeimg = $('#largeImg img'); | |
$('.thumbs a').each(function(){ | |
var jQ = $(this); | |
var path = jQ.attr('href'); | |
var alt = jQ.attr('title') || ''; | |
var img = $('<img/>').load(function(){ | |
var pld = $(this), imgHeight = pld.height(); | |
jQ.click(function(){ | |
largeimg | |
.css({ | |
height: /* Do whatever you need to do here to | |
fix your padding. Image height stored in local variable "imgHeight" */ | |
}) | |
.attr({src: path, title: alt}); | |
}); | |
}); | |
img.attr('src', path); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment