znalazłem w sieci poniższy przykład:
index.html
<!DOCTYPE html> <html> <head> <meta name='author' content='Eric Martin' /> <meta name='copyright' content='2013 - Eric Martin' /> <!-- Page styles --> <link type='text/css' href='css/demo.css' rel='stylesheet' media='screen' /> <!-- Contact Form CSS files --> <link type='text/css' href='css/basic.css' rel='stylesheet' media='screen' /> <!-- IE6 "fix" for the close png image --> <!--[if lt IE 7]> <link type='text/css' href='css/basic_ie.css' rel='stylesheet' media='screen' /> <![endif]--> <!-- JS files are loaded at the bottom of the page --> </head> <body> <div id='container'> <div id='logo'> </div> <div id='content'> <div id='basic-modal'> </div> <!-- modal content --> <div id="basic-modal-content"> </div> <!-- preload the images --> <div style='display:none'> <img src='img/basic/x.png' alt='' /> </div> </div> <div id='footer'> </div> </div> <!-- Load jQuery, SimpleModal and Basic JS files --> </body> </html>
basic.css
/* * SimpleModal Basic Modal Dialog * * * Licensed under the MIT license: */ #basic-modal-content {display:none;} /* Overlay */ #simplemodal-overlay {background-color:#000;} /* Container */ #simplemodal-container {height:360px; width:600px; color:#bbb; background-color:#333; border:4px solid #444; padding:12px;} #simplemodal-container .simplemodal-data {padding:8px;} #simplemodal-container code {background:#141414; border-left:3px solid #65B43D; color:#bbb; display:block; font-size:12px; margin-bottom:12px; padding:4px 6px 6px;} #simplemodal-container a {color:#ddd;} #simplemodal-container a.modalCloseImg {background:url(../img/basic/x.png) no-repeat; width:25px; height:29px; display:inline; z-index:3200; position:absolute; top:-15px; right:-16px; cursor:pointer;} #simplemodal-container h3 {color:#84b8d9;}
jak zrobić aby modal owierał się automatycznie po wejściu na stronę www (lub po jakimś czasie)? Teraz trzeba nacisnąć przycisk, a tak bym nie chciał. Proszę o pomoc.