![]() |
zoom functionality?
Hello,
I have some pictures on my page that I want to add zooming functionality, that is, when a visitor clicks on an image, he will be able to zoom in and out on it. Any ideas on how this can be done? |
It's called resizing. Google for things like bicubic, bilinear. Some languages have supportive libraries for it.
|
You could use DHTML:
http://resources.bravenet.com/script...es/image_zoom/ more: http://www.google.com/search?sourcei...tml+image+zoom |
well, I have something coded in Javacript that seems to work. But it changes the dimensions of the picture, while I want it to zoom in depth and not change the initial dimensions.
I have written: <html> <body> <img src="picture" width="86" height="37" onclick="this.width = this.width*2; this.height = this.height*2" id="image" /> <br /> <a href="java script:void(0);" onclick="document.getElementById('image').width = document.getElementById('image').width/2; document.getElementById('image').height = document.getElementById('image').height/2;">Zoom out</a> <br />Click on image to zoom in </body> </html> |
Use the CSS clip property on your image.
style="clip: rect(toplimitpx, rightlimitpx, bottomlimitpx, leftlimitpx);" If you want to zoom to the center, then you'll need to reposition the image to put the center in the clip region. |
| All times are GMT -5. The time now is 3:10 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC