Results 1 to 4 of 4

Thread: ondblclick="goNow()" multiple instances

  1. #1
    Join Date
    Jul 2005
    Location
    UK
    Posts
    159
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default ondblclick="goNow()" multiple instances

    I found this neat little script to only goto link on doubleclick:

    Code:
    <script>function goNow() {document.location="http://www.google.com/";}</script>
    		<a href="#" ondblclick="goNow()">google</a>
    but i need to use this several places on the site. how do i do this? i tried using goNow(1), goNow(2), etc, but it didn't work. obviously i'm a javascript beginner, so cut me a little slack. thanks in advance.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    How 'bout this?:
    Code:
    <a href="http://google.com" onclick="return false;" ondblclick="window.location.href=this.href">Google</a>
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    moscarda (02-02-2009)

  4. #3
    Join Date
    Jul 2005
    Location
    UK
    Posts
    159
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    thats perfect, thanks so much

  5. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I'm glad to help you anytime moscarda. Your welcome .
    Jeremy | jfein.net

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
  •