Welcome Guest, Not a member yet? Register   Sign In
Problems with jquery and ci

Hi to everybody, I'm currently developing a dynamic menu system using jquery.

Here the code of the function jquery


But when i put the code on the view of the ci app the script doesn't work

Code of view

<ul id="n">
                        <li class="a-S">&lt;?php echo anchor('#soluzioni','SERVIZI' ,array('class'=>'buttons')) ?&gt;<span class="arw"></span></li>
                        <li>&lt;?php echo anchor('#come_funziona','COME FUNZIONA' ,array('class'=>'buttons')) ?&gt;</li>
                        <li>&lt;?php echo anchor('#prezzi','PREZZI' ,array('class'=>'buttons')) ?&gt;</li>
                       <li>&lt;?php echo anchor('#faq','FAQ' ,array('class'=>'buttons')) ?&gt;</li>
                       <li>&lt;?php echo anchor('welcome/contatti', 'CONTATTI'); ?&gt;</li>

function toggleDiv(divId) {

$('.buttons').click(function (e){
    var divId = $attr('href');



<div id="soluzioni">Text</div>
<div id="come_funziona">Text</div>
<div id="prezzi">Text</div>
<div id="faq">Text</div>

you should not need to call another function to toggle the div.

$(document).ready(function() {

        var divId = $attr('href');
        return false;


Theme © iAndrew 2016 - Forum software by © MyBB