SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JS + FF driving me CRAZY

    I am going up a wall here.

    I am using a drop down script from smartwebby.com

    Here is a page you can view to see the menu in action. It works perfectly in IE, but stays left aligned in FF.

    http://dev2.bitwisesolutions.com/Ind...05/default.asp

    Here is the JS file
    http://dev2/Indypartnership2005/js/drop_down_menus.js

    Why does FF want this to stay left aligned? The position is absolute, so it should have free reign upon the page I thought.

    Thanks
    Bryan

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Portsmouth UK
    Posts
    1,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Had a quick look

    the positioning (left & top) needs some units 'px'.

    IE does not care about the niceities

  3. #3
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, not sure where you are referring to, but the positioning of the menu's is in the jS file, and you can't add px to the number in the script. It will break it.

  4. #4
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I assume SmartWebby has a sample of the code you are using - I'd check that in firefox first to see if the problem is theirs or yours.

  5. #5
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know it works in Firefox. We have another site we use it on and it works perfect. I literally have copied the code exactly how it is on the other website, yet this one won't move right for some reason. No clue why.

  6. #6
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Portsmouth UK
    Posts
    1,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I can see

    this bit sorts the positioning and it recognises getElementById


    if (NS4 || IE4) {
    eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerVis+'"');
    eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top="'+menuTop+'"');
    eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
    }
    if (NS6) {
    eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerVis+'"');
    eval(layerRef+'("'+layerName+'")'+styleSwitch+'.top="'+menuTop+'"');
    eval(layerRef+'("'+layerName+'")'+styleSwitch+'.left="'+eval(layerName+'L')+'"');


    menuTop is an Integer

    Moz FF, NS7 requires menuTop+'px';

    Code spends resource for NS4, who uses NS4 now?

    code needs updating for current stds

    suggest you use a more uptodate script, there are many to chose from

  7. #7
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm, I tried adding px to this

    eval(layerRef+'("'+layerName+'")'+styleSwitch+'.left="'+eval(layerName+'L')+'px');

    and that didn't work.

  8. #8
    SitePoint Guru
    Join Date
    Feb 2005
    Posts
    602
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's still wrong. You forget the " at the end of the string. It needs to be:

    eval(layerRef+'("'+layerName+'")'+styleSwitch+'.left="'+eval(layerName+'L')+'px"');

    I couldn't access the script (redirected me to some freshmeat.net site), but the use of eval makes me think this is an outdated script.

  9. #9
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Portsmouth UK
    Posts
    1,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    still the wrong syntax but there are other issues to be addressed to work in FF

    again
    suggest you use a more uptodate script, there are many to chose from

    but if you are determined to use this one I could rewrite it tonight but then it wont be the same script


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •