Web Analytics Made Easy -
StatCounter Javascript Macintosh Compatibility - Emergency! - CodingForum

Announcement

Collapse
No announcement yet.

Javascript Macintosh Compatibility - Emergency!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Javascript Macintosh Compatibility - Emergency!

    Hello All,

    A bit of an emergency here as I have to deploy this very soon and just ran across a macintosh compatibility issue. I use a standard drop-down menu that works beautifully in IE and Netscape on PC, but not at all on Mac. Here's what I'm doing.

    I have this script in the head of the document:

    _______________________________
    var head="display:''"
    img1=new Image()
    img1.src="fold.gif"
    img2=new Image()
    img2.src="open.gif"

    var ns6=document.getElementById&&!document.all
    var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

    function checkcontained(e){
    var iscontained=0
    cur=ns6? e.target : event.srcElement
    i=0
    if (cur.id=="foldheader")
    iscontained=1
    else
    while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
    if (cur.id=="foldheader"||cur.id=="foldinglist"){
    iscontained=(cur.id=="foldheader")? 1 : 0
    break
    }
    cur=ns6? cur.parentNode : cur.parentElement
    }

    if (iscontained){
    var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
    if (foldercontent.style.display=="none"){
    foldercontent.style.display=""
    cur.style.listStyleImage="url(open.gif)"
    }
    else{
    foldercontent.style.display="none"
    cur.style.listStyleImage="url(fold.gif)"
    }
    }
    }

    if (ie4||ns6)
    document.onclick=checkcontained
    ____________________________

    Then, for the menu I have this inside of a table:
    ____________________________

    <ul>
    <li id="foldheader"><img src="images/getinvolved.gif"></li>
    <ul id="foldinglist" style="display:none" style=&{head};>
    <li><a class="link" href="getinvolved/contribute.html">Contribute</a></li>
    <li><a class="link" href="getinvolved/volunteer.html">Volunteer</a></li>
    <li><a class="link" href="getinvolved/registertovote.html">Register to Vote</a></li>
    <li><a class="link" href="getinvolved/localpaper.html">Write to your Local Paper</a></li>
    </ul>
    ___________________________
    I have a graphic (images/getinvolved.gif) and when the user clicks on it, it drops down with the other options. Like I said, it works great on everything but Mac. On mac, the images appear to be clickable (The "click" icon appears) but when I click absolutely nothing happens. I know I'm asking for a lot, but I *really* appreciate any help. Thank you!

    Luke
    Last edited by Outshine; Mar 1, 2004, 07:21 PM.

  • #2
    I will paypal $50.00 to anyone who can help me fix this problem. Thanks

    Comment

    Working...
    X