Following is the code as per your requirement so try this code:
HTML
<div id="container">this is container div</div>
<div class="wrp">this is wrp div</div>
<input type="button" value="toggle" id="toggle-button">
CSS
#container {
width:960px;
background-color: red;
}
.wrp {
width:1000px;
background-color: green;
}
JS
$(document).ready(function () {
var setWidth = $.cookie("width");
if (typeof setWidth !== "undefined" && setWidth == "85%") {
$('#container,.wrp').width(setWidth); // 85% width set using cookie
} else if (typeof setWidth !== "undefined" && setWidth == "960px") {
$('#container,.wrp').width(setWidth); // 960px,1000px(for wrp) width set using cookie
}
$('#toggle-button').click(function () {
var toggleWidth = $("#container").width() == 960 ? "85%" : "960px";
$('#container, .wrp').animate({
width: toggleWidth
});
$.cookie('width', toggleWidth);
});
});
Note: you have to include jquery.cookie.min.js into your file for cookie to get work