I am trying to achieve photo zooming effect using this example: http://www.tympanus.net/Tutorials/PhotoZoomOutEffect/ .
However, I needed to make this effect working after page load, not on hover.
So I changed hover() to ready():
$(function() {
$('#container img').ready(
function(){
var $this = $(this);
$this.stop().animate({
'opacity':'1.0',
'height':'200px',
'top':'0px',
'left':'0px'
});
},
function(){
var $this = $(this);
$this.stop().animate({
'opacity':'0.5',
'height':'500px',
'top':'-66.5px',
'left':'-150px'
});
}
);
});
And then I had the JS error in Chrome debugger:
Uncaught TypeError: Cannot use ‘in’ operator to search for ‘display’ in undefined
Could someone, please, give me a hint to resolve this issue?
Thanks in advance.
you can do it like this if you have images with different dimensions
you need to set some values in CSS: