abdua5s Posted May 10, 2015 Share Posted May 10, 2015 hey i wanted to ask how to make a ad pop up on thwe side of page like there will be a box showing ad but a man who visits will click hide and it will collapse any idea how to do it i am using word press Link to comment Share on other sites More sharing options...
davej Posted May 10, 2015 Share Posted May 10, 2015 See... http://www.w3schools.com/css/tryit.asp?filename=trycss_display_none ...which can easily be modified like this... <!DOCTYPE html><html><head><meta charset="utf-8"><title>tab</title><style>.hidden { display: none;}.display { display: block; cursor:pointer; background-color:yellow;}</style><script>window.onload = init;function init(){setTimeout(showit,5000);}function showit(){var it = document.getElementsByClassName('hidden')[0];it.className = 'display';it.onclick = hideit;}function hideit(){var it = document.getElementsByClassName('display')[0];it.className = 'hidden';}</script></head><body><h1>This is a visible heading</h1><h1 class="hidden">This is a hidden heading (Click Here)</h1><p>Notice that the h1 element with display: none; does not take up any space.</p></body></html> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now