Mikael Noone schrieb:
> Hi there,
> 
> I used the interface plugin to make a window be draggable,
> now i found a good cookie plugin:
> http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/ 
> <http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/>
> 
> How do i use them to make it remember the position?...
> Ive tried alot of examples of ordinary javascript + cookie
> but i cant get it to work with the plugin.
> 
> I appriciate all help (sorry for bad english, im german)..
> 
> Thanx. Nisse.

If you have the position stored in a variable as a string like for example

var pos = 'x=112,y=330';

you can easily save this in and read it from the cookie like this:

var POS_COOKIE = 'window_position';

// get latest position
var pos = $.cookie(POS_COOKIE);

// save position, cookie expires after one year
var pos = ...;
$.cookie(POS_COOKIE, pos, {expires: 365});

For computing the window position the dimensions plugin is probably 
useful. Or maybe there's something build into Interface already.


-- Klaus


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to