i have the following script that shows a div when a link is clicked...
$(document).ready(function() {
$('.accordion ul li h1').click(function() { $(this).parent().parent().find('.ac:visible').slideToggle().parent().removeClass('active'); if ($(this).next().is(':hidden')) $(this).next().slideToggle().parent().addClass('active'); });
});
I also have a div on my page
<div id="shortinfo">short info</div>
How would i go about setting short info to didssapear when the link is clicked,, and reappear once its clicked again?
I tried adding
<h1 onclick="document.getElementById('shortinfo').style.display='none'">
but then i need it to reappear once its clicked again?
this is my new code, doesnt seem to work witht he toggle
$(document).ready(function() {
$('.accordion ul li h1').click(function() { $(this).parent().parent().find('.ac:visible').slideToggle().parent().removeClass('active'); if ($(this).next().is(':hidden')) $(this).next().slideToggle().parent().addClass('active'); });
$('#shortinfo').toggle();
});