Results 1 to 8 of 8

Thread: Pop-it Menu Help

  1. #1
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Pop-it Menu Help

    1) Script Title: Pop-It Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/popit.htm

    3) Describe problem: Hi, I have edited this script so it fits in with my game, i have left every other part of the script alone, but I made a function up to get the "linksets" automatically, using a function called arrayits. The problem is, it works in Firefox, but it doesn't work in IE 6, but it works in IE7, here is the script that I edited:
    http://www.seresel.com/functions.js

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Are you getting any particular errors? I would need to see a call to arrayits() that didn't work to have a better idea. If the linkset array is ever looped through at any time, it would need to have consecutive values from whatever (usually 0) to whatever, valid for the loop. The parameter called id must be a number not a string (no quotes around it in the call to arrayits). Some of your URLs look a little suspect if they are to be rendered as HTML by the script, this shouldn't be a problem in IE 6 but might. If any of arrayits() parameters are also the id's or names of elements on your page, this often can cause problems in IE which often assumes document.all['id'] and document['name'] for variable names that are not formally declared using the var constructor and even sometimes for those that are.

    This looks like it could be a problem:

    (<color=blue>'+health+'</color>)

    and using the & in a URL later rendered as HTML should be expressed as &amp; so that the browser doesn't try to resolve what follows it as a named or numbered entity.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I use arrayits() bound with my php, eg this:
    Code:
    <script>arrayits({$trueofo},\"".$assoc['name']."\",".$position['x'].",".$posy.",".$i.",false,false,".$assoc['id'].",'".$npc['name']."',".$npc['health'].")</script><img src=\"images/".$assoc['name'].".gif\" border=0 height=\"32\" width=\"32\" onMouseover=\"javascript:showmenu(event,linkset[".$i."])\" onMouseout=\"delayhidemenu()\">
    It is pretty complicated, but it isn't actually for reading.. Ill see what taking out the health bit does. But on IE it splurts out the error:
    Code:
    'menuobj.style' is null or not an object, line 50,and line 84

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    One thing that you might try is changing:

    Code:
    clearhidemenu()
    menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
    menuobj.innerHTML=which
    me . . .
    to:

    Code:
    clearhidemenu()
    menuobj=document.all? document.all['popitmenu'] : document.getElementById("popitmenu")
    menuobj.innerHTML=which
    me . . .
    and make sure you have no other objects in your code or on your page with the name or id of popitmenu. IE is not case sensitive in these matters, although it should be, so Popitmenu could interfere with popItmenu or popitmenu, etc.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    it still not working... thanks for trying anyway

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I thought it would be worth a try. If I had a link to the problem page or a demo of it, I might be able to be of more help but, the use of PHP makes it hard to be certain. However, it looks to be a javascript error so - it should be traceable to at least the PHP output that is causing it. You also might want to check in the PHP forum - PHP is not one of my strong points.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Oct 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It is fixed. I changed all occurances of "menuobj." with "document.getElementById("popitmenu").", now it works in all browsers ^__^

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    No it doesn't but, it should work in most modern browsers.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •