javascript - include in document.referrer in "else if" -


i have script displays modal if no cookie. first if, if cookie exists hides modal, , "else" if there no cookie, display it.

i need add document.referer condition below.

besides verifying cookie if not exist check referer (the same function below), , display modal.

the code:

jquery(document).ready(function() {    if (jquery.cookie('visits') > 0.5) {      jquery('#active-popup').hide();      jquery('#popup-container').hide();      jquery('html, body').removeattr('style');    } else {      var pageheight = jquery(document).height();      jquery('<div id="active-popup"></div>').insertbefore('body');      jquery('#active-popup').css("height", pageheight);      jquery('#popup-container').show();      jquery('html, body', window.parent.document).css({        'overflow': 'hidden',        'height': '100%'      });    }      $(document).ready(function() {      $('#popup-container').css({        'left': (math.floor(math.random() * 15) + 3) + '%'      })      $('#popup-container').css({        'top': (math.floor(math.random() * 23) + 33) + '%'      })    });  });

the refer

  if (document.referrer) {     facebook = /facebook.com/;     if (facebook.test(document.referrer)) {      }   } 

change else else if condition want.

jquery(document).ready(function() {    facebook = /facebook\.com/;    if (jquery.cookie('visits') > 0.5) {      jquery('#active-popup').hide();      jquery('#popup-container').hide();      jquery('html, body').removeattr('style');    } else if (document.referrer && facebook.test(document.referrer)) {      var pageheight = jquery(document).height();      jquery('<div id="active-popup"></div>').insertbefore('body');      jquery('#active-popup').css("height", pageheight);      jquery('#popup-container').show();      jquery('html, body', window.parent.document).css({        'overflow': 'hidden',        'height': '100%'      });    }      $(document).ready(function() {      $('#popup-container').css({        'left': (math.floor(math.random() * 15) + 3) + '%'      })      $('#popup-container').css({        'top': (math.floor(math.random() * 23) + 33) + '%'      })    });  });


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -