![]() |
Image expand/zoom script problem
Hello dear codingforums members...
This is my first post, I have this script which is used to expand/zoom an image to make it look larger.. But it only works in IE but not in Firefox or Google Chrome... Can anyone have a look and help out... I came to know that img.style.width=obj.width*2; is not supported in chrome and fire... So if there is some alterations I could make to the code... Code:
function Large(obj){ document.getElementById("imgbox").style.visibility='hidden'; } So there is a hidden div with id=imgbox on the html page, when mouse is hovered on a thumbnail,this div gets visible and the image is increased in width and height and displayed...when on mouse out its invisible... works in IE .... |
See how I have added a line here. This is the code you need to include for FF and other browsers. And I also added for the hidden part.
Code:
imgbox.style.visibility='visible'; |
Quote:
It wasnt exactly what i needed but helped me to understand what had to be done... ff and chrome cant understand "imgbox.style.width" they only need to be converted to "imgbox.width" for the zooming effect to work on ff and chrome.. |
Quote:
obj.style.width = 300+'px'; I can't tell you how many times I've been caught out by forgetting to include the +'px' |
| All times are GMT +1. The time now is 09:55 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.