Here’s a simple tutorial on how to show/ hide a div using Jquery. First we include the Google Jquery link, the next steps simple. it’s just a function that toggles the div with an id of slidingDiv, the height attribute means that the div will slide in from the top this can be changed to ‘width’ in order for the div to slide in from the left. We also set the duration of the animation which in our case is 1 second.
The JavaScript:
The HTML:
01 | < a onclick = "ShowHide(); return false;" href = "#" >Show/hidea > |
04 | Fill this space with really interesting content that you can < a onclick = "ShowHide(); return false;" href = "#" >hidea >div > |
Although this code technique is simple its often required in projects.
This entry was posted in
Design,
Downloads,
Javascript,
Tutorials,
jQuery and tagged
Javascript,
jQuery. Bookmark the
permalink.
No comments:
Post a Comment