12-14-2007, 01:44 PM
|
#1 (permalink)
|
|
The Acquainted
Join Date: Sep 2007
Posts: 126
Thanks: 4
|
Cookie issue -jQuery
Hey guys! i'm using the jQuery cookie plugin.
My project had seo-friendly url's. Each module is in a seperate directory. I have a draggable menu, a cookie is make with the coordinates. Here's a snippet of the jQuery code:
Code:
<script type="text/javascript">
$().ready(function() {
$('#sidebar').draggable({
handle: 'div#logo',
opacity: 0.8,
zIndex: 50,
stop: function() {
var y = $('#sidebar').css('top');
var x = $('#sidebar').css('left');
jQuery.cookie('menu_position', x+','+y, 20, { expires: 7, path: '/', domain: 'intreli.com', secure: true });
}
});
var pos = jQuery.cookie('menu_position').split(',');
$('#sidebar').css({ position: 'absolute', top:pos[1], left:pos[0] });
});
</script>
I want the cookie to be made once and the same one to be read all over the domain, nomatter which directory/module you are viewing. However, each directory appears to have a seperate cookie. (each dir has a cookie with a path where that module is - something I dont want :()
|
|
|
|