View Full Version : Slashdot Menu FF1+ IE5+ Opr7+

02-28-2007, 10:54 AM
1) Script Title: Slashdot Menu FF1+ IE5+ Opr7+

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/slashdot.htm

3) Describe problem: Is it possible to add links to the menu titles so when clicked they open a new page and then drop down the correct sub menu?

Can anyone help me, please?

03-01-2007, 10:35 PM
I've just implemented this menu on my page as well (almost, I've got alot of links to add for submenus...). I would love to have clicking the tab display a new page and expand the submenu as well! I'm researching this today and will post if I find a solution.

I'm sure the answer lies in the bit of code that states

titles[i].onclick = gomenu;
arrows[i].onclick = gomenu;

I'm extremely new to javascript, so excuse my ideas if they're a bit off, but it looks like the event we're looking to update is the onclick event for both titles and arrows. If we could add something to the gomenu function... But, it couldn't be generically in the gomenu function, because the link would vary depending on which title and associated arrow was clicked....

So... the function gomenu is in the same js file... And unfortunately I'm not familiar enough with javascript to think of how to alter the code. Anyone else know?

03-06-2007, 09:26 PM
Anyone have any ideas on this? I've been working frantically on some other things and put this on a backburner, but would love to see if there's a solution! Maybe just add the same function as what happens when you click anywhere on the submenu box to the expand function of the main menu?

03-09-2007, 09:06 PM
After leaving this a few days, I think I've figured it out and am going to test this.... Rather than changing the code in the gomenu event, or worrying about needing to have it vary with the appropriate menu items (the array will take care of that), I think just adding this function to the menu class (as well as the arrows and titles) will do the trick.

I'll let you know if I have success....

03-09-2007, 10:36 PM
My idea of adding the gomenu event to the menu class isn't working as easily as I thought... I'm thinking maybe use the span tag's "onclick" event to go to the new page and expand the menu. Only thing is that I don't know enough javascript to use the onclick event handler to open a new window. Could anyone show me how to do this? Many thanks.

Or alternately, if you have any other ideas of how this might work please let me know.

Laura Schofield

03-15-2007, 07:32 PM
I've seen a couple of people look to customise this in this forum. Wanting previously opened submenus to collapse when a new one is expanded, this issue of opening a new page....

Anybody have experience with javascript that could help on this?

03-22-2007, 03:47 AM
No response at all?

03-22-2007, 06:51 AM
Well I kinda achieved what you want, see the zip file.
Replace your js, css files and look at the sample html.
I just changed spans to as and altered the script to look for as.

Btw, the target attribute is not defined in Strict doctypes.

03-22-2007, 01:57 PM
Thank you!!!! I know target isn't allowed in strict dtds, but I've managed to validate in transitional, so thats something at least...

As I'm doing affiliate marketing, I'd like to keep opening links in new windows atleast until I get more traffic (which I just need to work on content I think to get quality backlinks). When I took out the target attributes to try to validate in strict, my click throughs dropped DRAMATICALLY, so I put target refs back in and went for transitional.

Thanks for the input though! BTW - I'm completely self taught (7 years ago I did sql, vba and some C++ though in college - no web programming, not even html). When I started my site, I just used a wysiwyg editor and it was a mess code-wise. Got rid of the majority of tables and went mainly CSS, started using serverside includes, just starting to do keyword research and optimize for that (although I'm using TRANSITIONAL valid html 4.01), and also looking at seo techniques as well.... I just code with notepad and paste it into my file manager now.

I'm doing tutorials in javascript right now and find it to not be that difficult, I've just got too much going on. Thanks again for this! I'm going to give it a try now!