This is a frequency cap cookie for a basic slide toggle, that I have not used in a while works in FF IE does not work in Chrome, Cap is based on calendar day, no 24-hour period. I'm happy to report this problem check my file locally in my browser. Uploaded to the server, cookie is set in chrome Chrome will not forget this fact about
jQuery.noConflict (); JQuery (document) .ready (function () {var PAGEURL = location.href.toLowerCase (); sbFirstSlide = (document.cookie.indexOf ('SBB _' + PAGEURL) == -1); // Check the Cookie Check on the top today on sbTrigger = jQuery ('# slidebartrigger'); slideState = 0; // 0 up =, 1 = downward downTM; upTM; function slideUp () {if (slideState == 1) { If (downTM) clearTimeout (downTM); jQuery ("# slidebar") slideToggle (200); slideState = 0; sbTrigger.removeClass ("closeSlide") one ('click', slideDown);}} function slideDown () {If (upTM) clearTimeout (upTM); jQuery ("# slidebar") slideToggle (500); slideState = 1; sbTrigger.removeClass ("firstSlide"); sbTrigger.addClass ("closeSlide "). (SlideUp 'click');}} setSBBCookie () {var Oneday = new Date (); oneDay.setUTC Date (oneDay.getUTCDate (+1); oneDay.setUTCHours (0, 0, 0, 0); // day-per day instead of 24 hours, really set daily document.cookie = "sbb_" + PAGEURL + " = True path = /; ending = "+ oneDay.toUTCString (); } If (sbFirstSlide) {slideDown (); SetSBBCookie (); DownTM = setTimeout (slideUp, 3000); } Other {sbTrigger.removeClass ("First Slide"). One ('click', slidedown);}});
The issue you're probably running in is that Google Chrome does not allow you Set up cookies When you run a local file you will need to run it from some type of server or use something like JSFDell. If you try to run your code on the webserver, such as JSField you will see that the cookie is set in Google Chrome
Comments
Post a Comment