i have a ul and li list.When i click on the UL List then it expands and collapse...
below is my links inside ul and li tag.
<ul class="treeview-menu">
<li><?php echo $this->Html->link(__('Add Users'), array('controller' => 'Users', 'action' => 'addSubUsers', 'plugin' => false)); ?></li>
<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'Users', 'action' => 'listSubUsers', 'plugin' => false)); ?></li>
</ul>
Now i need when i click on the Add Users link the ul tag display like below
<ul class="treeview-menu" style="display: block;">
i created below code for this...but this is not working......
<li><?php echo $this->Html->link('Add Users',array('controller'=>'Users','action'=>'addSubUsers','plugin' => false),array('id' => 'myId')); ?></li>
<script type="text/javascript">
$( "#myId" ).click(function() {
$(".treeview-menu").css("display":"block");
});
</script>
Add script when click "Add User" id:
$( "#adduser" ).click(function() {
$(".treeview-menu").css("display":"none");
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With