The Little Guy Posted August 6, 2009 Share Posted August 6, 2009 If you take a look at this page using firefox, then chrome/safari: http://www.dudeel.com/home.php?id=2 When you mouse over the images in the "Photo Gallery" section, you should notice that firefox enlarges the images correctly, but chrome/safari doesn't. if((verOffset=browser.indexOf("Chrome"))!=-1 || (browser.indexOf("Safari")) != -1){ mLeft = -(width / 2)+"px"; }else{ mLeft = -(width / 2)+"px"; } img.setAttribute("style", "position:absolute;margin-top:"+mTop+";margin-left:"+mLeft+";"); The above is basically what I use, inside the first if statement, is the code for "Chrome" and "Safari" The bottom is for everything else (haven't tested on much yet). After the if statement, it sets the style of the image, and the left margin doesn't display correctly in Chrome/Safari. Anyways, any ideas how to make the image enlarge correctly in chrome/safari? I can't find a good formula to handle this in chrome/safari. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted August 12, 2009 Author Share Posted August 12, 2009 bump Quote Link to comment Share on other sites More sharing options...
haku Posted August 13, 2009 Share Posted August 13, 2009 I can't say for sure - usually I just play with these things until I find something that works. But maybe try this for Chrome/Safari mLeft = "-" + (width / 2) +"px"; If it works, it actually may work for other browsers as well, removing the need for the conditional. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.