Mostrar 1 sola vez on load (!visited)

$(document).ready(function() { $(function() { // establecer si es o no la primera vez var visited = localStorage['visited']; // si es about, que aparezca como ya visitado if ($('#about').length) { localStorage['visited'] = true; } // primera vez if (!visited) { console.log('primera vez'); init(); localStorage['visited'] = true; } // show function init() { // a los tres segundos de load setTimeout(function () { // note $("#note").addClass("active"); }, 3000); setTimeout(function () { // popup window.dlg = new DialogFx( window.pop_news ); dlg.toggle(); }, 8000); // cerrar $('#note .close-button').click(function() { $(this).parent().removeClass('active'); }); } }); });

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.