Page 1 of 1

[SOLVED] Need help with menu

Posted: Sat Oct 17, 2009 2:43 pm
by DirtyMusic
Sorry, my native language is not english. But I will try to explain the problem.

I have a menu with that display all pages on level one (all parents). If one of the pages have a sub page (childeren), the subpage will show if someone click the level one link in the menu.

Image
http://bildr.no/image/508569.jpeg

The problem is that when someone click the parent, the submenu only shows for some seconds before the browser goes back to root. I have used this method on other pages with luck, but not on this site. How come?

Re: Need help with menu

Posted: Sat Oct 17, 2009 2:46 pm
by replytomk3
Give me the link, or admin password, or stylesheet/template and I will take a look.

Re: Need help with menu

Posted: Sat Oct 17, 2009 2:59 pm
by DirtyMusic
replytomk3 wrote: Give me the link, or admin password, or stylesheet/template and I will take a look.
Ths page isn't launched yet, So I don't have anything to show you yet. But here is the template code:

Code: Select all

{if $count > 0}
	<ul class="pages" style="position:relative;">
	{foreach from=$nodelist item=node}
		{if $node->depth > $node->prevdepth}
			{capture assign=count_value}{counter name=c1}{/capture}
			{repeat string="<div class='menuChildren menuChildren$count_value' id='menuChildren$count_value' style='display:none;'><ul class='children'>" times=$node->depth-$node->prevdepth}
			{elseif $node->depth < $node->prevdepth}
			{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
		</li>
		{elseif $node->index > 0}
			</li>
		{/if}
		{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
			<li class="current_page_item showSubmenu" id="menuChildren{counter name=c2}">
				<a {elseif $node->current == true}
			<li class="current_page_item">
				{elseif $node->haschildren == true}
			<li class="showSubmenu" id="menuChildren{counter name=c2}">
				{elseif $node->type == 'sectionheader'}
			<li>{$node->menutext}{elseif $node->type == 'separator'}
			<li style="list-style-type: none;"> <hr class="separator" />{else}
			<li>
			{/if}
			{if $node->type != 'sectionheader' and $node->type != 'separator'}
				<a {if $node->haschildren == true}href="#"{else}href="{$node->url}#"{/if}>{$node->menutext}</a>
			{elseif $node->type == 'sectionheader'}
				{$node->menutext}</a>
		{/if}
	{/foreach}
	{repeat string="</li></ul></div>" times=$node->depth-1}
	</li>

	</ul>
{/if}



{literal}
  <__script__>
		$(document).ready(function(){

			//Hide all megamenus
			$('.menuChildren').hide(); 

			$(".showSubmenu").click(function(){
			
				// Check if any megamenu is shown?
				var numMegaVisible = 0;
				$('.menuChildren').each(function() {
					if (this.style.display == 'block') numMegaVisible++;
				}); 

				//If any megamenu is shown
				if (numMegaVisible) { 

					// Hide current megamenu
					var currentVisible = $('.menuChildren.'+this.id).css("display");
					if (currentVisible == 'block') {
						$('.menuChildren.'+this.id).slideUp();		
					} else {
					
						// Hide all megamenus
						$('.menuChildren').hide();
						
						// Show wanted megamenu
						$('.menuChildren.'+this.id).slideToggle(); 
						
					}
					
				} else if (this.id != ''){	// If none megamenu is open

					// Show wanted megamenu
					$('.menuChildren.'+this.id).slideDown();
				}

			});

		});
  </__script>
{/literal}

Re: Need help with menu

Posted: Sat Oct 17, 2009 3:06 pm
by replytomk3
A stylesheet would be nice, too.

Re: Need help with menu

Posted: Sat Oct 17, 2009 3:09 pm
by replytomk3
DirtyMusic wrote: I have used this method on other pages with luck, but not on this site. How come?
Unless enough details like stylesheet, menu calling code (for both pages) is listed, how do you expect to get help? And login/link would show someone immediately what is going on.

Re: Need help with menu

Posted: Sat Oct 17, 2009 3:32 pm
by DirtyMusic
Well, not to be rude or something but I will not give a stranger the login to my homepage. And how can the stylesheet help anyone to answer the question?

I should have asked for a solution in a another way, so I try again:

When the href="#" in the a-tag the page shouldn't reload or go to root again. But still it does. Why?

Re: Need help with menu

Posted: Sat Oct 17, 2009 4:04 pm
by Jeff
We ask for the stylesheet because most of the display setting are handled with the style sheet (atleast they should).

Re: Need help with menu

Posted: Sat Oct 17, 2009 4:11 pm
by DirtyMusic
ajprog wrote: We ask for the stylesheet because most of the display setting are handled with the style sheet (atleast they should).
That's alright. But what in the sylesheet does override the fact that when someone click a link with the # as a value in the href?

Code: Select all



/* Menu */
#navigation ul li a:link, #navigation ul li a:active, #navigation ul li a:visited {
	margin:0; padding:13px 15px;
	font:bold 1.08em Arial, Helvetica, sans-serif; color:#34393e;
	display:block;
	outline: none;

}

#navigation ul li a:hover {
	color:#000;
	font-weight:bold; text-decoration:underline;
	outline: none;

}

#navigation ul.pages li.current_page_item a:link, #navigation ul.pages li.current_page_item a:active, #navigation ul.pages li.current_page_item a:visited {
	/* Crazy margins to pull up the hover image above the borders.*/
	margin:-3px 0 0 0; padding:15px 15px 14px 15px;
	background:#171615 url(/images/navigation-hover.gif) repeat-x bottom center;
	color:#f1f8ff; position:relative;
	outline: none;

}


#navigation ul.pages li.showingSubMenu {
	background	:	url(images/navigation-h.gif) repeat-x;
}

.menuChildren {
	background: url(/images/navigation-mega.gif) no-repeat scroll center bottom;
	height				:	118px;
	left				:	3px;
	padding				:	10px 5px 5px 5px;
	margin				:	0px;
	width				:	927px;
	float				:	left;
	position			:	absolute;	
	z-index				:	1000;	
}

		.menuChildren ul.children {
			margin	:	10px 0px 0px 20px;
			padding	:	0px;
			list-style	:	none;
		}
		
				.menuChildren ul.children li {
					float				:	left;
					background-image	:	none !important;
					background			:	none !important;
				}
				
				.menuChildren ul.children li a, .menuChildren ul.children li a:link, .menuChildren ul.children li a:visited, .menuChildren ul.children li a:active {
					background-image	:	none !important;
					background			:	none !important;
					color				:	#34393E !important;
				}


Re: Need help with menu

Posted: Wed Oct 21, 2009 4:38 pm
by DirtyMusic
I don't belive there is the menu template or the style that makes this problem. Can it be anything to do with the .htaccess -file? I have followed these steps: http://wiki.cmsmadesimple.org/index.php ... ty_URL.27s

Re: [SOLVED] Need help with menu

Posted: Wed Oct 21, 2009 6:03 pm
by replytomk3
Try turning it off then

Re: [SOLVED] Need help with menu

Posted: Sun Oct 25, 2009 6:07 am
by Dr.CSS
Do you have info in the parent page or is it a sectionheader?...