Note that there are some explanatory texts on larger screens.

plurals
  1. POHaving trouble getting cookies to work
    primarykey
    data
    text
    <pre><code>$(document).ready(function(){ var lastsettings = $.cookie('location'); if(lastsettings == "blue"){ $('fieldset').css('background-color', 'blue'); $('fieldset').css('margin-top', '0px'); $('fieldset').css('margin-left', '0px'); } else if(lastsettings == "red"){ $('fieldset').css('background-color', 'red'); $('fieldset').css('margin-top', '0px'); $('fieldset').css('margin-right', '0px'); } else if(lastsettings == "yellow"){ $('fieldset').css('background-color', 'yellow'); $('fieldset').css('margin-top', '240px'); $('fieldset').css('margin-left', '0px'); } else if(lastsettings == "green"){ $('fieldset').css('background-color', 'green'); $('fieldset').css('margin-top', '240px'); $('fieldset').css('margin-right', '0px'); } $('select').change(function(){ $('select option:selected').each(function(){ position = this.text; $('fieldset').css('margin', 'auto'); if(position == "Top Left"){ $('fieldset').css('background-color', 'blue'); $('fieldset').css('margin-top', '0px'); $('fieldset').css('margin-left', '0px'); $.cookie('position', 'blue'); } else if(position == "Top Right"){ $('fieldset').css('background-color', 'red'); $('fieldset').css('margin-top', '0px'); $('fieldset').css('margin-right', '0px'); $.cookie('position', 'red'); } else if(position == "Bottom Left"){ $('fieldset').css('background-color', 'yellow'); $('fieldset').css('margin-top', '240px'); $('fieldset').css('margin-left', '0px'); $.cookie('position', 'yellow'); } else if(position == "Bottom Right"){ $('fieldset').css('background-color', 'green'); $('fieldset').css('margin-top', '240px'); $('fieldset').css('margin-right', '0px'); $.cookie('position', 'green'); } else{ $('fieldset').css('background-color', 'white'); $('fieldset').css('margin', 'auto'); $('fieldset').css('margin-top', '100px'); } }); }); $("#invisibility").toggle(function(){ $('fieldset').css('visibility', 'hidden'); }, function(){ $('fieldset').css('visibility', 'visible'); }); }); </code></pre> <p>I'm using the jquery cookie plugin, but when I refresh my page it goes back to normal. I am coding a website where I move a box to a certain location using a fieldset, but when I refresh my page the box moves back to It's original position instead of the position I set it to before the refresh.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload