User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Jan 2008
Location: istanbul
Posts: 264
Reputation: serkansendur is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 23
serkansendur's Avatar
serkansendur serkansendur is offline Offline
Posting Whiz in Training

Firefox background-position problem solved

  #1  
Mar 11th, 2008
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.

  1. <div id="container" style="background-image: url(images/navigationMenut/left-tile.jpg);background-repeat: no-repeat; background-position: left 109px;">
  2. </div>

I insert the following script right after the container div.

  1. <script>
  2. // checks the browser type to see if it is firefox
  3. if (navigator.appName.indexOf('Netscape') != -1)
  4. {
  5. // changes the position accordingly
  6. document.getElementById('container').style.backgroundPosition
  7. = "left 107px";
  8. }
  9. </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
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 2:45 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC