PDA

View Full Version : DD Tab Menu II Question



Brill
08-05-2005, 06:12 PM
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

Twey
08-05-2005, 06:42 PM
Change
onClick=\"expandcontent('sc1', this)\" to
onClick=\"expandcontent('sc1', this);return false;\"
That'll stop any unwanted side effects from the links.

Brill
08-05-2005, 07:30 PM
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

jscheuer1
08-05-2005, 08:37 PM
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:

<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:

<a href="http://url/" onclick="expandcontent('sc1', this);return false;">Home</a>and it works fine, repeatedly. So, it would probably be best to:

.

Brill
08-08-2005, 08:09 PM
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

jscheuer1
08-09-2005, 07:26 AM
In the script, set the:

//Disable hyperlinks in 1st level tab images?
var disabletablinks=1 //0 for no (default), 1 for yesto zero:

//Disable hyperlinks in 1st level tab images?
var disabletablinks=0 //0 for no (default), 1 for yes

Brill
08-09-2005, 01:42 PM
That did the trick. Thanks for your assistance :)

Have a good day - Brill