![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 54
Rep Power: 3
![]() |
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? |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
It's called resizing. Google for things like bicubic, bilinear. Some languages have supportive libraries for it.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
You could use DHTML:
http://resources.bravenet.com/script...es/image_zoom/ more: http://www.google.com/search?sourcei...tml+image+zoom
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#4 |
|
Programmer
Join Date: Oct 2005
Posts: 54
Rep Power: 3
![]() |
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> |
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|