Results 1 to 7 of 7

Thread: DD Tab Menu II Question

  1. #1
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DD Tab Menu II Question

    I am using this excellent script in a category type search function. (very similar to msn.com's search)

    I like the ease of use and deployment I had with the script however I was wondering how I could edit the script so that you had to click on the images instead of mouseovers.

    Here is how the code looks initially -
    <a href=\"http://url/\" onMouseover=\"expandcontent('sc1', this)\">Title</a>

    AND I changed it to do this -
    <a href=\"http://url/\" onClick=\"expandcontent('sc1', this)\">Title</a>

    The problem I have with the onClick is that when I click on one of the images it acts like a hyperlink and forwards to a page that doesnt exist (http://url) EVEN though I placed a 1 on disabletablinks. When onClick is present it totally ignores disabletablinks.

    The mouseover version works perfectly other than the fact that it doesnt fit the scope of my project. I need click activation only.

    Any ideas on what part of the code I need to edit to achieve this?

    Thanks for the great script!
    Brill

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Change
    Code:
    onClick=\"expandcontent('sc1', this)\"
    to
    Code:
    onClick=\"expandcontent('sc1', this);return false;\"
    That'll stop any unwanted side effects from the links.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you Twey,

    That did the trick however you can only click on the image one time, after that you cant select the image again.

    Is the onClick function not allowing a second click?

    Brill

  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

    Quote Originally Posted by Brill
    Here is how the code looks initially -
    <a href=\"http://url/\" onMouseover=\"expandcontent('sc1', this)\">Title</a>
    No it doesn't, it looks like this:
    Code:
    <a href="http://url/" onMouseover="expandcontent('sc1', this)">Home</a>
    Why have you added the downslash (\) escapes for the double quotes? Have you made it an external file using document.write? Or is something else up? In any event, in answer to another question on this same menu I created a demo that uses onclick and here is what the above code looks like in it:
    Code:
    <a href="http://url/" onclick="expandcontent('sc1', this);return false;">Home</a>
    and it works fine, repeatedly. So, it would probably be best to:

    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

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

  5. #5
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok sorry for the wait I had to build it up outside if my internet so that you could see it.

    http://togglespin.com/wordforge/searchdemo.php

    YES it was commented because I have embedded it with PHP.

    If you mouse over the images and click on it it will stay. However if you click off of it and then try to click it again... its a no go.

    Its like click once or something.

    Twey gave me this code - onClick=\"expandcontent('sc1', this);return false; as opposed to the initial code I had - onMouseover=\"expandcontent('sc1', this)

    Thanks for any assistance you can provide.
    Brill

  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

    In the script, set the:
    Code:
    //Disable hyperlinks in 1st level tab images?
    var disabletablinks=1 //0 for no (default), 1 for yes
    to zero:
    Code:
    //Disable hyperlinks in 1st level tab images?
    var disabletablinks=0 //0 for no (default), 1 for yes
    - John
    ________________________

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

  7. #7
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That did the trick. Thanks for your assistance

    Have a good day - Brill

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
  •