vijay

welcome Netizen

Share Your Knowledge.It is a way to achieve immortality

Thursday, March 15, 2012

Zooming a image using JavaScript


Here its very simple  code in java script to do zoom   a  pictures..
In a previous article I wrote about the image zooming using ajax slide extender..for your reference I added the link below……..
http://www.dotnetcode.in/2012/02/resize-image-using-ajax-slider-extender.html

Here to add below code onclient click event in the button..Here I kept two button for zoom in and zoom out..When click the button the image has zoom for every click.

Even if you do small modification on that code for your needs it will work for the entire browser window…
JavaScript code:

<script type="text/javascript">
        var image = document.getElementById('Image2');
        function ZoomIn() {
            document.getElementById('Image2').width += 100;
            document.getElementById('Image2').height += 100;
        }
        function ZoomOut() {
            document.getElementById('Image2').width -= 100;
            document.getElementById('Image2').height -= 100;
        }
    </script>



I hope you like it..

0 comments:

Post a Comment