Question

I'm using html5/css3 modal window from here http://www.webdesignerdepot.com/2012/10/creating-a-modal-window-with-html5-and-css3/ , you turn it off by clicking on link

<a href="#close">X</a>

but how could I make it to work like this with a function?

<div onclick="someFunction">
content
</div>

Thank you.

Was it helpful?

Solution

Try this

<div onclick="someFunction('close')">content</div>

function someFunction(action){
  window.location.hash=action;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top