J query for Zoom in Zoom Out

This is simple coding for zoom in and zoom out in j query.





ZOOM IN J query


$(document).ready(function(){
$(".zoomin").click(function(){
$(".demo").animate({
height:'+=100px',
width:'+=100px'
});
});


ZOOM OUT J query 


$(".zoomout").click(function(){
$(".demo").animate({
height:'-=100px',
width:'-=100px'
});
});

});

Full Coding


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zoom in Zoom Out In J query</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
$(document).ready(function(){
$(".zoomin").click(function(){
$(".demo").animate({
height:'+=100px',
width:'+=100px'
});
});

$(".zoomout").click(function(){
$(".demo").animate({
height:'-=100px',
width:'-=100px'
});
});

});
</script>

</head>

<body>
<div align="center">
<h3>Zoom in Zoom Out</h3>
<img src="zoom.jpg" width="150" height="150" class="demo" />
<p><img src="zoomin.png" width="32" height="32" class="zoomin" />&nbsp;<img src="zoomout.png" width="32" height="32" class="zoomout"/>
</p>
</div>
</body>
</html>


No comments:

Post a Comment