SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    there is no box baztorres's Avatar
    Join Date
    May 2004
    Location
    UK - London \ Surrey
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    shoing a layer then reverting to previous layer ... Why, how?

    Hello,

    On the following link, I have used JavaScript to show and hide a layer. But when you click on the link, it shows the layer for a second or 2 and then it goes back to the previous layer.

    http://uk.geocities.com/jp.batten@btopenworld.com/

    How comes it does this??

    It worked as intended when using w2k and msie5.5 when creating this at home, now when looking at it at work (xp, msie6), it is doing what I have mentioned above.
    Baz
    ---

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The js is working but the page is getting reloaded. You need to cancel the A element's default action by returning false in the onclick handler...
    Code:
    <a href="index.htm" onClick="MM_showHideLayers('displayMainHome','','hide','displayMainAffiliate','','show');return false">Affliations</a><br>

  3. #3
    there is no box baztorres's Avatar
    Join Date
    May 2004
    Location
    UK - London \ Surrey
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah right. Thanks very much.
    Baz
    ---


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
  •