The simple example playing with jquery
By adding "rel" attribute, we can toggle specific elements.
slideToggle(). <script>
$(function(){
$('.toggle').click(function(){
var el = $(this).attr('rel');
$(el).slideToggle();
});
});
</script>
<button class="stoggle" rel="#hideMe">Click me</button>
<br />
<div id="hideMe" style="background: #ffffd0; display: none; height: 100px; text-align: center; width: 200px;">
I'm the hidden element
</div>
Demo:
or toggle the element above: By adding "rel" attribute, we can toggle specific elements.
No comments :
Post a Comment