resizing images jquery
by victusfate
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>
post
</title>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
SetupGrowingDivs();
});
function SetupGrowingDivs() {
var scale = 1.5;
$('div.front').find('img').live({
mouseover: function() {
$(this).css('z-index', '5');
$(this).css('overflow', 'visible')
var old_width = parseInt($(this).css('width'));
var old_height = parseInt($(this).css('height'));
$(this).stop().animate({
width: old_width * scale,
height: old_height * scale,
left: 0,
top: 0,
},
200);
},
mouseleave: function() {
var old_width = parseInt($(this).css('width'));
var old_height = parseInt($(this).css('height'));
$(this).stop().animate({
width: old_width / scale,
height: old_height / scale,
left: 0,
top: 0
},
200);
$(this).css('overflow', 'hidden')
$(this).css('z-index', '1');
}
});
...