logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Spry
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 07-01-2011, 03:21 PM   #1
andystyl
 
Join Date: Jun 2011
Posts: 5
Default Spry Menu Click Issue

Hello, I 've been checking your answers for 3-4 weeks now, on the spry menu and I 've got 2 questions that it would really be appreciated if someone could answer...

Is it possible for the <.a href="#"> to be removed and not screw the way IE handles the menu?

Actually what I really want, is not having the site get "refreshed" if someone by accident clicks on a menu item with a sub-menu included.
and the second...

If someone clicks on a sub-menu item, I have a picture swap function on the onClick event, if he goes for another sub-menu item, the sub-menu closes down and he's forced to repeat the navigation to get to that sub-menu item. Google chrome handles the menu bar exactly the way I want it. If you wouldn't mind checking out the site (http://www.eletthes.gr) with an IE or a Firefox and then with Chrome u would understand what I'm saying, but I'm guessing you are already aware if this behavior.

Is there a way to replicate the way Chrome handles the menu bar in Firefox and IE?

Forgive me for the long post, I've been trying to get answers of the web with no luck so far.
andystyl is offline   Reply With Quote
Old 07-01-2011, 05:01 PM   #2
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

I'm not familiar with SPRY, but if it is insert <a href="#"> it si doing it wrong.
If it's not a link, it should not use <a>
domedia is offline   Reply With Quote
Old 07-02-2011, 06:02 AM   #3
andystyl
 
Join Date: Jun 2011
Posts: 5
Default

I wish it were so, if you remove even just the href="#", the menu doesn't work on IE, but the weird thing is, only the first 2 menus items dont work (if a menu item has a sub-menu, when you try to select an item from the sub-menu, the sub-menu disappears).
On firefox the menu behaves just like google chrome, but again only for the first 2 menu items. If I remove the <a></a> tags completely, same thing happens. So bottom line, it needs <a href="#"></a> to every item for the spry menu to even work, at least in the way it does.
andystyl is offline   Reply With Quote
Old 07-03-2011, 12:29 AM   #4
DWcourse
DWcourse's Avatar
 
Join Date: Apr 2009
Posts: 3,276
Default

you have to have the link in a spry menu. You can try a javascript null link

a="javascript: void(0)"

Requires javascript but then so does the spry menu.
__________________
If my answer helped, check out DWcourse.com for Dreamweaver tips and tutorials.
DWcourse is offline   Reply With Quote
Old 07-04-2011, 11:37 AM   #5
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

Jim, I'm not familiar with spry, but can't you just replace <a> with something else?
domedia is offline   Reply With Quote
Old 07-04-2011, 12:59 PM   #6
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

As far as I can see in SpryMenuBar.js you'll need an anchor tag to show the submenus. See var link.
Code:
// show and hide submenus
Spry.Widget.MenuBar.prototype.initialize = function(listitem, element) {
var opentime, closetime;
var link = listitem.getElementsByTagName('a')[0];
var submenus = listitem.getElementsByTagName('ul');
var menu = (submenus.length > 0 ? submenus[0] : null);
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 07-04-2011, 03:05 PM   #7
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

My point was that in order to correct the markup, you could maybe replace it.
domedia is offline   Reply With Quote
Old 07-04-2011, 03:39 PM   #8
DWcourse
DWcourse's Avatar
 
Join Date: Apr 2009
Posts: 3,276
Default

Well, you'd have to add some styles and javascript for the replacement element to look/function properly. At which point, I'd probably recommend a jQuery solution i you're going to be doing that much work anyway.
__________________
If my answer helped, check out DWcourse.com for Dreamweaver tips and tutorials.
DWcourse is offline   Reply With Quote
Old 07-04-2011, 04:19 PM   #9
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

I also believe it's not worth the hassle while there are other JavaScript frameworks that do a much better job. Spry kind of sucks IMO... no graceful degradation, no nothing.
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 07-05-2011, 03:11 PM   #10
andystyl
 
Join Date: Jun 2011
Posts: 5
Default

i guess i could try jQuery...seeing that theres no easy way getting past this issue...thanks for the hassle of reply folks
andystyl is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:22 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com