Zaczne od tego iz naprawde robie początki w jquery , ale mam potrzebe zrobienia takiej wiadomości gdy użytkownik zamyka stronę , skrypt pochodzi z tej strony :
http://www.bitrepository.com/exit-modal-box.html
Wszystko fajnie tylko problem jest w tym iż zawsze jak ktoś najeżdza na zamkniecie strony , lub chce cofnąć pokazuje mu się to , a ja chciałbym nie denerwować użytkownika tylko np pokazać mu to raz (zapis do cookie) i spokoj np na 7 dni
poczytałem troszke o pluginie do jquery o cookie z tej strony :
https://github.com/carhartl/jquery-cookie
wynik z html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link type='text/css' href='basic.css' rel='stylesheet' media='screen' /> <script type="text/javascript" > $.cookie('myCookie2', 'myValue2', { expires: 7, path: '/', domain: 'example.com', secure: true }); </script> <style type="text/css"> <!-- .notice { background-color: #f2faf2; border: 1px solid #cdcdcd; padding: 5px; margin: 5px; } --> </style> </head> <body> hhgg <div style="display: none; padding: 10px;" id="exit_content"> <h1>Goodbye visitor!</h1><h3>Thanks for visiting us!</h3><br />Aenean cursus vehicula augue. Pellentesque tincidunt. Donec auctor, justo quis commodo iaculis, eros libero suscipit ipsum, et lobortis mauris erat ac arcu. Praesent dolor libero, porta id, feugiat vitae, porttitor pharetra, elit. Quisque ullamcorper, elit vitae rhoncus rhoncus, massa erat porttitor felis, sit amet viverra diam purus quis tellus. Ut sed massa sed nibh mollis aliquam. Nullam rutrum. Sed a risus. Donec ligula diam, auctor tempus, convallis ut, ultricies eget, massa. Duis rutrum, diam id gravida consectetur, justo augue pellentesque velit, sit amet scelerisque nunc erat vel sapien. Proin ullamcorper. Vestibulum hendrerit pellentesque metus. Mauris tempor nunc at sapien. </div> </body> </html>
niestety pewnie robie jakiś błąd i proszę o pomoc , ewentualnie jeżeli znacie inne lepsze wyjście na zrobienie takiego czegos prosiłbym też o pomysły ewentualne jakieś rozwiązania
pozdrawiam
ps. skrypt niestety musi tak działać , taki mam problem i niestety musi pokazywac sie takie cos na zakonczenie