Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //the popup will not show if the user close it by pressing close button. If click then it will not show for certain time.
- function showNewsletter(){
- //get the data either the close button clicked or not
- $('#newsletterclose').click(function(){
- $(this).data('clicked', true);
- });
- //check the cookie and if close button clicked. once both true the popup will not show
- if(localStorage.getItem('popNewsletter') != 'active' && !$('#newsletterclose').data('clicked')){
- $("#newsletter").addClass(' active');
- localStorage.setItem('popNewsletter','active');
- }
- //if close button clicked the popup will close
- $('#newsletterclose').click(function(){
- $("#newsletter").removeClass(' active');
- });
- //use can trigger the popup anytime by clicking the button
- $('a[href="#newsletteractive"]').click(function(){
- $("#newsletter").addClass(' active');
- });
- };
Add Comment
Please, Sign In to add comment