For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
DirtyMusic
Forum Members
Posts: 15 Joined: Sat Nov 08, 2008 9:27 am
Post
by DirtyMusic » Sat Oct 17, 2009 2:43 pm
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.
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?
Attachments
Last edited by
DirtyMusic on Wed Oct 21, 2009 5:08 pm, edited 1 time in total.
replytomk3
Post
by replytomk3 » Sat Oct 17, 2009 2:46 pm
Give me the link, or admin password, or stylesheet/template and I will take a look.
DirtyMusic
Forum Members
Posts: 15 Joined: Sat Nov 08, 2008 9:27 am
Post
by DirtyMusic » Sat Oct 17, 2009 2:59 pm
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}
replytomk3
Post
by replytomk3 » Sat Oct 17, 2009 3:06 pm
A stylesheet would be nice, too.
replytomk3
Post
by replytomk3 » Sat Oct 17, 2009 3:09 pm
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.
DirtyMusic
Forum Members
Posts: 15 Joined: Sat Nov 08, 2008 9:27 am
Post
by DirtyMusic » Sat Oct 17, 2009 3:32 pm
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?
Jeff
Power Poster
Posts: 961 Joined: Mon Jan 21, 2008 5:51 pm
Post
by Jeff » Sat Oct 17, 2009 4:04 pm
We ask for the stylesheet because most of the display setting are handled with the style sheet (atleast they should).
DirtyMusic
Forum Members
Posts: 15 Joined: Sat Nov 08, 2008 9:27 am
Post
by DirtyMusic » Sat Oct 17, 2009 4:11 pm
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;
}
replytomk3
Post
by replytomk3 » Wed Oct 21, 2009 6:03 pm
Try turning it off then
Dr.CSS
Moderator
Posts: 12711 Joined: Thu Mar 09, 2006 5:32 am
Post
by Dr.CSS » Sun Oct 25, 2009 6:07 am
Do you have info in the parent page or is it a sectionheader?...