I have a row of images, and when one of the images is clicked it expands while also shrinking any other image that may be enlarged. If you click on the enlarged image, it just shrinks itself.
I'm receiving a 'shrink is not defined' error message. Thanks in advance.
$.fn.grow = function(size,rate) {
$(this).addClass('click').animate({'height': size}, rate);
}
$.fn.shrink = function(size,rate) {
$('img').removeClass('click').animate({'height': size}, rate);
}
$(document).ready(function() {
$('#gallery img').click(function() {
var $this = $(this);
($this.hasClass('click')) ? $this.shrink('139', '200') : $this.shrink('139', '200').grow('700', '200');
});
});
$are valid in JavaScript.