+ 1
How can I make an element, so that it is hided first, and then when I tap to show, it is showed?
2 odpowiedzi
+ 5
use javascript
<p id='paragraph' style='display: none'>test</p>
<button id='btn'>show</button>
<script>
button = document.getElementById('btn');
paragraph = document.getElementById('paragraph');
button.onclick = function() {
if (paragraph.style.display == 'none') {
paragraph.style.display = 'block';
}
else {
paragraph.style.display = 'none';
}
}
</script>
+ 2
If you check jQuery tutorial, there are describe how to hide/show elements on some events it is a first lesson in effects module.