•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 373,364 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,649 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1288 | Replies: 0
![]() |
I had a background image for one of the container divs in my page. I positioned it to a specific pixel using its style properties. It worked fine in the internet explorer but was located to a wrong position when displayed by firefox. So i wrote the following code to get around this problem, it worked.
I insert the following script right after the container div.
This approach can be applied to all style conflicts between firefox and internet explorer.
html Syntax (Toggle Plain Text)
<div id="container" style="background-image: url(images/navigationMenut/left-tile.jpg);background-repeat: no-repeat; background-position: left 109px;"> </div>
I insert the following script right after the container div.
html Syntax (Toggle Plain Text)
<script> // checks the browser type to see if it is firefox if (navigator.appName.indexOf('Netscape') != -1) { // changes the position accordingly document.getElementById('container').style.backgroundPosition = "left 107px"; } </script>
This approach can be applied to all style conflicts between firefox and internet explorer.
Last edited by peter_budo : Mar 12th, 2008 at 12:46 pm. Reason: Keep It Organized - please use [code] tags
Serkan Şendur
MCAD.NET
MCAD.NET
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
advertisment advice browser browsers browsing cell chain mail daniweb development email email misuse encryption eu eudora firefox firefox background-position problem solved gmail google imap internet internet explorer 7 javascript smooth scrolling scroll smoothly window document position microsoft mobile mozilla networking news onecare open source opinion outlook penelope phishing phones professional research scam security social spam spammers spamming stocks technology thunderbird uk.government update panel scroll problem virus web webmail
- Previous Thread: Preventing the delay when src attribute of the images set via javascript
- Next Thread: how to prevent javascript menu from getting hidden under flash movies


Linear Mode