Results 1 to 9 of 9

Thread: dropTabs

  1. #1
    Join Date
    Jan 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default dropTabs

    1) Script Title:
    Drop down Tabs
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...roptabmenu.htm
    3) Describe problem:

    http://pastebin.ca/829892

    It seems if i have the drop down be for the first link it works.. But if i start it at the second one it does not.

    It must be because of the rel... Each one gets an auto rel even if it has no drop downs , Seems like the best way to do it cms wise..


    The chrome drop down did not seem to mind this.
    Last edited by complexity; 12-23-2007 at 04:10 PM.

  2. #2
    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

    You will need to post a link to the actual page, as the code in your link has a rel for each item, so shouldn't be a problem as long as those are configured properly, which I cannot tell from the code you supply:

    Please post a link to the web page on your site that demonstrates the problem so we can check it out.


    But the bottom line is, don't give one of these a rel attribute if you don't intend to use it as a part of the script.
    - John
    ________________________

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

  3. #3
    Join Date
    Jan 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    <li><a href="#" rel="dropmenu58" title="Technology"><span>Technology</span></a></li>

    As you can see in my paste bin that is the second top level link..

    Only the second top level link has the drop down...

    Not the first link...

    And that makes it so the drop down does not work.

    But if i take the rel out of the first link The second link drop down works , but it is not really easy to do in my case.

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmm do you have an actual example of the script running on that page? All I see is snippets of code posted, but not the actual script itself running.

  5. #5
    Join Date
    Jan 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    http://weknowfirst.com/demo/index.html

    Notice that i have taken the rel out of the first top level link.. Which makes the second top level link drop down work..

    But if i add a rel to it, the second drop down stops working , unless i have a drop down for the first one

    With Chrome Drop down menu , you could have rels on anyone and it would not effect it.
    Last edited by complexity; 12-24-2007 at 02:25 PM.

  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

    Don't add the rel to it then, unless you intend to use it with the script. Any rel that doesn't have a menu associated with it wil break rels after it that do. You could try editing the script (addition red):

    Code:
    	init:function(menuid, dselected){
    		this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
    		var menuitems=document.getElementById(menuid).getElementsByTagName("a")
    		for (var i=0; i<menuitems.length; i++){
    			if (menuitems[i].getAttribute("rel")&&document.getElementById(menuitems[i].getAttribute("rel"))){
    				var relvalue=menuitems[i].getAttribute("rel")
    				document.getElementById(relvalue).firstlink=document.getElementById(relvalue).getElementsByTagName("a")[0]
    				menuitems[i].onmouseover=function(e){
    					var event=typeof e!="undefined"? e : window.event
    					tabdropdown.dropit(this, event, this.getAttribute("rel"))
    				}
    			}
    			if (dselected=="auto" && typeof setalready=="undefined" && this.isSelected(menuitems[i].href)){
    				menuitems[i].parentNode.className+=" selected default"
    				var setalready=true
    			}
    			else if (parseInt(dselected)==i)
    				menuitems[i].parentNode.className+=" selected default"
    		}
    	}
    I hope this is obvious, but even this will still have problems if there is an element on the page with an id that matches the rel, but that is not intended to be a drop down menu.
    Last edited by jscheuer1; 12-24-2007 at 03:26 PM. Reason: add info
    - John
    ________________________

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

  7. #7
    Join Date
    Jan 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK I guess its back to the chrome menu then....

    I would need the rel on every one, This menu is generated so everyone must have a rel.

    Thanks anyways.

  8. #8
    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

    I edited my last post, you might now find it more useful.
    - John
    ________________________

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

  9. #9
    Join Date
    Jan 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thank you

    That seemed to do the trick.. I have not found any drawbacks yet!

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
  •