SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict I don`t mind's Avatar
    Join Date
    Feb 2006
    Location
    LA
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onClick always scrolls to top -.-

    Hello there,

    I have the following problem: On my page are several links which if the user clicks on it opens a div-box below with some text in it. The only thing that doesn’t work is that the page is always scrolled to top because of the onClick Event. Is there any possibility to stop scrolling the page to top? Unfortunately I have to use the onClick Event


    Thanks in advance
    Words are weapons of Mass Destruction.

  2. #2
    SitePoint Addict dAEk's Avatar
    Join Date
    Oct 2003
    Location
    Stockholm, Sweden
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <a href="some/page.html" onclick="doStuff(this.href); return false;">A link</a>
    Notice the return false part.
    David Shamloo-Ekblad

    Go Habs! | For music addicts: Last.fm, SongMeanings

  3. #3
    SitePoint Addict I don`t mind's Avatar
    Join Date
    Feb 2006
    Location
    LA
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's it. Thanks
    Words are weapons of Mass Destruction.


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
  •