xoops forums

Burning

Theme Designer
Posted on: 2009/10/4 23:32
Burning
Burning (Show more)
Theme Designer
Posts: 1163
Since: 2006/8/22
#1

iMenu and accordeon

hi'

I'm trying to add Accordeon script (JQuery) to iMenu block.
My aim is to display submenus :
• by pointing mouse on Main link
• and without necessary display module page
... iMenu behavior is the same than Main menu block : submenus are displayed only for active module on page.

Block template code is :
<table cellspacing="0">
  <
tr>
    <
td id="mainmenu">
      <!-- 
start module menu loop -->
    <{
assign var=start value=1}>
      <{foreach 
item=imenu from=$block.contents}>
      <{if 
$imenu.link != ""}>
        <{if 
$start}>
              <
class="menuTop" href="<{$imenu.link}>" target="<{$imenu.target}>"><{$imenu.title}></a>
          <{
assign var=start value=0}>
        <{else}>
          <{if 
$imenu.sub == "1"}>
                  <
class="menuSub" href="<{$imenu.link}>" target="<{$imenu.target}>"><{$imenu.title}> <{if $imenu.messages }>(<span style="color:#ff0000; font-weight: bold;"><{$imenu.messages}></span>)<{/if}></a>
          <{else}>
              <
class="menuMain" href="<{$imenu.link}>" target="<{$imenu.target}>"><{$imenu.title}> <{if $imenu.messages }>(<span style="color:#ff0000; font-weight: bold;"><{$imenu.messages}></span>)<{/if}></a>
          <{/if}>
        <{/if}>
        <{else}>
            <{
$imenu.title}>
        <{/if}>
      <{/foreach}>
      <!-- 
end module menu loop -->
    </
td>
  </
tr>
</
table>


... it seems that it is not possible to do what I would with this code. Is someone can give me some advice ?

Thanks in advance


nb : sorry for my bad english

Burning

Theme Designer
Posted on: 2009/10/30 20:05
Burning
Burning (Show more)
Theme Designer
Posts: 1163
Since: 2006/8/22
#2

Re: iMenu and accordeon

Thanks someone! Wonderful

(I send a PM to jegelstaff)

jegelstaff

Module Developer
Posted on: 2009/12/21 22:39
jegelstaff
jegelstaff (Show more)
Module Developer
Posts: 518
Since: 2004/7/2 2
#3

Re: iMenu and accordeon

This is very neat, thanks very much for sharing. We will see about including this in our next iMenu release.

--Julian

Burning

Theme Designer
Posted on: 2010/6/17 22:19
Burning
Burning (Show more)
Theme Designer
Posts: 1163
Since: 2006/8/22
#4

Re: iMenu and accordeon

hi',

I was looking for a nice hack coded by someone... it was in this thread.

Where ? there is nothing today, and why "someone" has been replaced by "someone"
Still learning CSS and... english

Burning

Theme Designer
Posted on: 2010/6/17 22:26
Burning
Burning (Show more)
Theme Designer
Posts: 1163
Since: 2006/8/22
#5

Re: iMenu and accordeon

Me again...

Hack is here (it was on pc) :
<script type="text/javascript" src="<{$xoops_url}>/jquery-accordion/lib/jquery.js"></script>
    <
script type="text/javascript" src="<{$xoops_url}>/jquery-accordion/lib/jquery.easing.js"></script>
    <
script type="text/javascript" src="<{$xoops_url}>/jquery-accordion/lib/jquery.dimensions.js"></script>
    <
script type="text/javascript" src="<{$xoops_url}>/jquery-accordion/jquery.accordion.js"></script>
<
script type="text/javascript">
    
jQuery().ready(function(){
        
        
// second simple accordion with special markup
        
jQuery('#navigation').accordion({
            
activefalse,
            
header'.menuTop',
            
navigationtrue,
            
event'mouseover',
            
fillSpacetrue,
            
animated'easeslide'
        
});
    });
    </
script>

<
div  style="margin-bottom:1em;">
    <
ul id="navigation">
        <
li>
      <{
assign var=start value=1}>
      <{foreach 
item=imenu from=$block.contents}>
      <{if 
$imenu.link != ""}>
        <{if 
$start}>
            <
class="menuTop" href="<{$imenu.link}>" target="<{$imenu.target}>"><{$imenu.title}></a>
            <
ul>
          <{
assign var=start value=0}>
        <{else}>
          <{if 
$imenu.sub == "1"}>
            <
li><class="menuSub" href="<{$imenu.link}>" target="<{$imenu.target}>"><{$imenu.title}> <{if $imenu.messages }>(<span style="color:#ff0000; font-weight: bold;"><{$imenu.messages}></span>)<{/if}></a></li>
          <{else}>
            </
ul>      
            </
li>
            <
li>
            <
class="menuTop" href="<{$imenu.link}>" target="<{$imenu.target}>"><{$imenu.title}> <{if $imenu.messages }>(<span style="color:#ff0000; font-weight: bold;"><{$imenu.messages}></span>)<{/if}></a>
            <
ul>
              
          <{/if}>
        <{/if}>
        <{else}>
        </
ul>      
        </
li>
        <
li>
            <{
$imenu.title}>
        <
ul>
            
        <{/if}>
      <{/foreach}>
        </
ul
        </
li>
    </
ul>
</
div>


... but someone ?
Still learning CSS and... english