Following is the code i was using for toggle.
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
It works fine in my computer. But when I use it in the server side, which calls to .asp pages, it does not work. I know I have to use .live() handler. I tried it with the jquery slidetoggle. but it is not working. The following is the html code
<div class="issue_button">
<a align="center" href="#" onclick="toggle_visibility('dropdown1');">Link</a></div>
<div id="dropdown1"> <p>Some text</p> </div>
Am I doing something wrong? Frankly I don’t know how to write the code with live handler.
Here’s the jquery solution for toggle.
http://jsfiddle.net/aJFSy/1/
Update
I would not use Live since its deprecated since 1.7
Delegate – http://api.jquery.com/delegate/
http://jsfiddle.net/aJFSy/2/
or
On
http://api.jquery.com/on/