質問

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.

役に立ちましたか?

解決

Try this

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

function someFunction(action){
  window.location.hash=action;
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top