[eluser]Unknown[/eluser]
Hi to everybody, I'm currently developing a dynamic menu system using jquery.
Here the code of the function jquery
http://jsfiddle.net/TEdcz/305/
But when i put the code on the view of the ci app the script doesn't work
Code of view
Code:
<ul id="n">
<li class="a-S"><?php echo anchor('#soluzioni','SERVIZI' ,array('class'=>'buttons')) ?><span class="arw"></span></li>
<li><?php echo anchor('#come_funziona','COME FUNZIONA' ,array('class'=>'buttons')) ?></li>
<li><?php echo anchor('#prezzi','PREZZI' ,array('class'=>'buttons')) ?></li>
<li><?php echo anchor('#faq','FAQ' ,array('class'=>'buttons')) ?></li>
<li><?php echo anchor('welcome/contatti', 'CONTATTI'); ?></li>
</ul>
[removed]
function toggleDiv(divId) {
$('#'+divId).show("slow").siblings().hide("slow");
}
$('.buttons').click(function (e){
e.preventDefault();
var divId = $attr('href');
toggleDiv(divId);
})
[removed]
<div id="soluzioni">Text</div>
<div id="come_funziona">Text</div>
<div id="prezzi">Text</div>
<div id="faq">Text</div>