jQuery: Click to hide element

ravish.tiwari

New Member
I have a small jQuery function below. It basically works by clicking on the element \[code\]#hover-trigger\[/code\], whether is be a link or image. This then makes a centralized div elementappear centrally on screen, in this case \[code\]#hover-content\[/code\].What I am wondering is, what function can I add onto the end of this one to make the \[code\]div\[/code\] disappear again when a certain element is clicked?\[code\]$(document).ready(function(){ $('#hover-trigger').click(function() { $(this).next('#hover-content').slideToggle(); $(this).toggleClass('active'); if ($(this).hasClass('active')) $(this).find('span').html('▲') else $(this).find('span').html('▼') })});\[/code\]
 
Back
Top