PDA

View Full Version : jQuery get position of div then save it to a cookie.



pxlcreations
05-22-2010, 08:45 PM
Hi guys, need some help here. I was getting help on the jQuery forum but the person who was working with me stopped replying, so I'm hoping one of you can help me. Here's what's happening. I have divs on a webpage that you can drag around the page on the iPhone/iPad (this is only meant for those devices). I want the position of the divs to be saved when the page is reloaded, by putting it into a cookie. So far, I am using these plugins..

http://plugins.jquery.com/project/Cookie
http://www.manifestinteractive.com/iphone/touch/

to drag the boxes around and save it to a cookie. Now I just need the code that get's the position and saves it. I got some help with it, and have this script:



$(document).ready(function(){
// does cookie exist?
if ($.cookie('the_cookie1')) {
var coordsOne = $.cookie('the_cookie1').split(',');
$('#theBox').css({top:coordsOne[0],left:coordsOne[1]});
}

if ($.cookie('the_cookie2')) {
var coordsTwo = $.cookie('the_cookie2').split(',');
$('#theBox2').css({top:coordsTwo[0],left:coordsTwo[1]});
}
});

Which gets the position of the boxes, and then saves it to a cookie. Now, I need to figure out how to have the boxes get record their position and set it as a cookie (does that make sense?). I was told to use this script:


$.cookie('the_cookie',$('#theBox').css('top')+','+$('#theBox').css('left'));

And I was supposed to put it on the "drag stop event" of the boxes, but I don't think the boxes have a drag stop event, or at least one I can't find. So, here is my JS code for the draggable boxes, where I think the code above would go...

http://jsbin.com/iraxe/edit
http://jsbin.com/akogu3/edit

Thank you for reading this, and any help is much appreciated.

pxlcreations
05-23-2010, 02:13 AM
Any ideas?

jscheuer1
05-23-2010, 06:05 AM
I have no iAnything to test this on, but . . .

If you could bind() touch(), you might be able to use bind's callback.

Also, you might consider, instead of applying touch() to all of those many elements by their id, trying it out like if you could just give each one of them the same class and just apply touch() to that class.

This, if it works, will not solve your problem, but will greatly simplify your code.

pxlcreations
05-23-2010, 10:46 AM
Yeah, I am pretty sure I could make them classes instead of ID's. And the cookie would work if that piece of code was run when the box was moved. There has to be some place in my JS that details it?

jscheuer1
05-23-2010, 01:43 PM
I think you want to edit the touch code. Here seems a likely candidate location (addition highlighted):


function touchmove(e){

if(_dragging && !_sizing && _animate) {

var _lastleft = (isNaN(parseInt($('#'+_target).css("left")))) ? 0:parseInt($('#'+_target).css("left"));
var _lasttop = (isNaN(parseInt($('#'+_target).css("top")))) ? 0:parseInt($('#'+_target).css("top"));
}

$(e.changedTouches).each(function(){

e.preventDefault();

_left = (this.pageX-(parseInt($('#'+_target).css("width"))/2));
_top = (this.pageY-(parseInt($('#'+_target).css("height"))/2));

if(_dragging && !_sizing) {

if(_animate){
_xspeed = Math.round((_xspeed + Math.round( _left - _lastleft))/1.5);
_yspeed = Math.round((_yspeed + Math.round( _top - _lasttop))/1.5);
}

if(_dragx || _dragy) $('#'+_target).css({ position: "absolute" });
if(_dragx) $('#'+_target).css({ left: _left+"px" });
if(_dragy) $('#'+_target).css({ top: _top+"px" });
$.cookie('the_cookie',$('#theBox').css('top')+','+$('#theBox').css('left'));
$('#'+_target).css({ backgroundColor: "" });
$('#'+_target+' b').text('');
}
});
};

But that's not exactly what you want to store at that point. You would probably want a reference to each draggable item's id and its coordinates (css left and top). A fair amount of information considering all the draggable elements you are working with. But probably not too much for a cookie in modern browsers, choose your delimiter wisely, don't use one that could be mistaken for part of the data, nor one that must be escaped. Remember, cookie information can only be stored as a string. So you would need some code to create that string with delimiters so that it could be parsed upon retrieval.

When this cookie is retrieved, you parse its string into sets of element id's with their coordinates, then find each of the elements by its stored id and set its position according to its stored coordinates.

pxlcreations
05-23-2010, 02:46 PM
Then maybe a cookie wouldn't be the best way to do it? Are there other options available?

jscheuer1
05-23-2010, 05:56 PM
As far as for what's available without server side code, a javascript cookie is about the best. Cookies can be disabled though, even when javascript is active. Usually they are active. Whatever method you choose, as far as I know, the information can only be stored as a string.

I see that the touch() code uses the element's id. I don't think it needs to be activated by that id. If so, you can give each draggable the same class, and keep each ones unique id. That way you could initialize them all with - say the class was, 'draggable', replacing this and similar:


$('#touchme1').touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});

with a single:


$('.draggable').touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});

But it might not work like that. But if we add the class anyway, we can simplify the cookie. You could make the name be the id. That way we could be setting a cookie for each draggable, only if they get moved:


function touchmove(e){

if(_dragging && !_sizing && _animate) {

var _lastleft = (isNaN(parseInt($('#'+_target).css("left")))) ? 0:parseInt($('#'+_target).css("left"));
var _lasttop = (isNaN(parseInt($('#'+_target).css("top")))) ? 0:parseInt($('#'+_target).css("top"));
}

$(e.changedTouches).each(function(){

e.preventDefault();

_left = (this.pageX-(parseInt($('#'+_target).css("width"))/2));
_top = (this.pageY-(parseInt($('#'+_target).css("height"))/2));

if(_dragging && !_sizing) {

if(_animate){
_xspeed = Math.round((_xspeed + Math.round( _left - _lastleft))/1.5);
_yspeed = Math.round((_yspeed + Math.round( _top - _lasttop))/1.5);
}

if(_dragx || _dragy) $('#'+_target).css({ position: "absolute" });
if(_dragx) $('#'+_target).css({ left: _left+"px" });
if(_dragy) $('#'+_target).css({ top: _top+"px" });
if(_dragx || _dragy) $.cookie(_target,($('#'+_target).css('top')||'')+'_'+($('#'+_target).css('left')||''));
$('#'+_target).css({ backgroundColor: "" });
$('#'+_target+' b').text('');
}
});
};

resulting in up to eight short cookies if all of the draggables get moved.

Then, when the page loads again, you could do as part of your document ready code:


$('.draggable').each(function(){
if($.cookie(this.id)){
var pos = $.cookie(this.id).split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
}
);

pxlcreations
05-23-2010, 07:05 PM
Right, I see what you're saying. And if none of them were moved, they would be in the default position? Plus, this would allow me to add more boxes, right?

jscheuer1
05-23-2010, 09:04 PM
This all assumes I've read the touch code properly, anticipated all important contingencies, and made no typos in my code. As I cannot test this, try it out. It should work with as many elements as the browser will allow cookies. I'm uncertain of the limits on cookies. It probably varies by browser, and these days, for most modern browsers, that's probably quite high.

If a particular element is not moved, no cookie will be set for it. So when the page loads the next time, no action will be taken as regards that element. It will remain wherever its default position is.

pxlcreations
05-23-2010, 09:21 PM
Ok, I set up the code like this.

1.) I changed the DIVs that get moved to this:



<div id="touchme1" class="draggable">
<!--Content Start -->
Test Box
<!--Content End -->
</div>


2.) I updated the #touchme 1, #touchme 2, etc. to .draggable:



$('.draggable').touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});


3.) I put this code in the head of my page:



$('.draggable').each(function(){
if($.cookie(this.id)){
var pos = $.cookie(this.id).split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
}
);

4.) I then put this in my external JS file:



function touchmove(e){

if(_dragging && !_sizing && _animate) {

var _lastleft = (isNaN(parseInt($('#'+_target).css("left")))) ? 0:parseInt($('#'+_target).css("left"));
var _lasttop = (isNaN(parseInt($('#'+_target).css("top")))) ? 0:parseInt($('#'+_target).css("top"));
}

$(e.changedTouches).each(function(){

e.preventDefault();

_left = (this.pageX-(parseInt($('#'+_target).css("width"))/2));
_top = (this.pageY-(parseInt($('#'+_target).css("height"))/2));

if(_dragging && !_sizing) {

if(_animate){
_xspeed = Math.round((_xspeed + Math.round( _left - _lastleft))/1.5);
_yspeed = Math.round((_yspeed + Math.round( _top - _lasttop))/1.5);
}

if(_dragx || _dragy) $('#'+_target).css({ position: "absolute" });
if(_dragx) $('#'+_target).css({ left: _left+"px" });
if(_dragy) $('#'+_target).css({ top: _top+"px" });
if(_dragx || _dragy) $.cookie(_target,($('#'+_target).css('top')||'')+'_'+($('#'+_target).css('left')||''));
$('#'+_target).css({ backgroundColor: "" });
$('#'+_target+' b').text('');
}
});
};


5.) I linked to the jQuery Cookie JS file like so:



<script type="text/javascript" language="javascript" src="js/cookie.js"></script>



And here's what happens, the DIVs can be moved around the page, but when I reload the page they are in their original positions. I don't know if these affects the cookie, but the DIVs are set up in CSS to be positioned in the middle of the page. I don't think it does affect it though.

jscheuer1
05-23-2010, 10:26 PM
I told you to put this:


$('.draggable').each(function(){
if($.cookie(this.id)){
var pos = $.cookie(this.id).split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
}
);

in your document ready section which I assume now looks like so:


$().ready(function(){
setInterval(checkOrientAndLocation,1000);
$('.draggable').touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});
});

So we could even do it like so:


$().ready(function(){
setInterval(checkOrientAndLocation,1000);
$('.draggable').each(function(){
if($.cookie(this.id)){
var pos = $.cookie(this.id).split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
}
).touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});
});

But to be on the safe side, perhaps:


$().ready(function(){
setInterval(checkOrientAndLocation,1000);
$('.draggable').each(function(){
if($.cookie(this.id)){
var pos = $.cookie(this.id).split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
}
);
$('.draggable').touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});

pxlcreations
05-23-2010, 10:33 PM
Ok, sorry for the confusion. I put that where you said to, the snippet of code wouldn't let me drag the DIVs so I tried the first one you posted...


$().ready(function(){
setInterval(checkOrientAndLocation,1000);
$('.draggable').each(function(){
if($.cookie(this.id)){
var pos = $.cookie(this.id).split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
}
).touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});
});

And that lets me move the DIVs, but when I move a DIV and then reload the page, the DIV is put back to it's original position.

jscheuer1
05-24-2010, 02:58 AM
I'm not sure what to tell you. First make sure you are not viewing an older cached version of the page. Perhaps cookies are unavailable on the iWhatever you are using. If it were a regular browser, I would move some things around and then paste or type this into the address bar:


javascript:alert(document.cookie)

And hit enter. You should see something like:


touchme2=5px_10px;touchme3=15px_131px;

One for each touchme you moved. If you don't see that, either the iWhatever you are using doesn't do javascript commands from the address bar, or doesn't do cookies, or we placed our cookie creation code in the wrong place or it is flawed.

If you do see something like that, then our cookie reading is flawed.

But it might be something else I'm not anticipating. Even though I cannot see what's happening exactly, it may help if I had a link to the page so I could at least see the code.

pxlcreations
05-24-2010, 11:57 AM
Alright, thank you for helping me so far too... it helps a lot.

So this is REALLY odd now... I added this to my code in Safari on my Mac:


javascript:alert(document.cookie)

And I got a blank popup with no text in it...

But when I do the same on my iPad (the device I'm using this for), I get this crazy paragraph of random text saying things like:

__utma=84032948.2349802.2349082.234908;
__utmz-77329847.234872.23423

I don't think that should be happening, and I have no idea where it's coming from!

Anyways, I will PM you a link to the site so you can look at the code.

EDIT: Looks like the __utma and __utmz are part of a cookie Google Analytics leaves... so it seems as if the position cookies aren't getting created correctly...

jscheuer1
05-24-2010, 12:07 PM
Well there would be no cookies for the touch in Safari on Mac, it doesn't do touch, right?

Checking for the cookies on iPad should only be done after you have moved some things around.

pxlcreations
05-24-2010, 12:15 PM
Good point, I just moved a DIV around and then checked for the cookie and got the same as above.

jscheuer1
05-24-2010, 12:20 PM
I just looked at your code. Your jquery.touch.js file hasn't been modified as I suggested it be here (addition highlighted):


function touchmove(e){

if(_dragging && !_sizing && _animate) {

var _lastleft = (isNaN(parseInt($('#'+_target).css("left")))) ? 0:parseInt($('#'+_target).css("left"));
var _lasttop = (isNaN(parseInt($('#'+_target).css("top")))) ? 0:parseInt($('#'+_target).css("top"));
}

$(e.changedTouches).each(function(){

e.preventDefault();

_left = (this.pageX-(parseInt($('#'+_target).css("width"))/2));
_top = (this.pageY-(parseInt($('#'+_target).css("height"))/2));

if(_dragging && !_sizing) {

if(_animate){
_xspeed = Math.round((_xspeed + Math.round( _left - _lastleft))/1.5);
_yspeed = Math.round((_yspeed + Math.round( _top - _lasttop))/1.5);
}

if(_dragx || _dragy) $('#'+_target).css({ position: "absolute" });
if(_dragx) $('#'+_target).css({ left: _left+"px" });
if(_dragy) $('#'+_target).css({ top: _top+"px" });
if(_dragx || _dragy) $.cookie(_target,($('#'+_target).css('top')||'')+'_'+($('#'+_target).css('left')||''));
$('#'+_target).css({ backgroundColor: "" });
$('#'+_target+' b').text('');
}
});
};

That's what would set the cookies. Without that, there will be no cookies for items moved via touch.

pxlcreations
05-24-2010, 12:27 PM
I'm an idiot. I forgot to upload the new JS file with the cookie setter in it.. :o

On the bright side, it works!

You know on the page, how you can show or hide the DIVs? Well, since I already am linking to the jquery cookie file, would it be easy to set a cookie that when the page loaded, the DIVs would be hidden or shown like they were before the reload?

jscheuer1
05-24-2010, 01:18 PM
Since all of your things that you are toggling the display of are the same as the things you are moving around, simply using their id would overwrite the cookie used for positioning. So we will need a different name for the display cookie. But, as long as these (the draggable ones and the ones that are toggled) remain the same group of elements, it allows us to check them at the same time.

Here's your toggler code:


function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}

We could modify it to add cookie creation:


function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block'){
e.style.display = 'none';
$.cookie('disp'+id, 'none');
} else {
e.style.display = 'block';
$.cookie('disp'+id, 'block');
}
}

And then, what we have here:


$().ready(function(){
setInterval(checkOrientAndLocation,1000);
$('.draggable').each(function(){
if($.cookie(this.id)){
var pos = $.cookie(this.id).split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
}
).touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});
});

could become:


$().ready(function(){
setInterval(checkOrientAndLocation,1000);
$('.draggable').each(function(){
if($.cookie(this.id)){
var pos = $.cookie(this.id).split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
var disp;
if((disp = $.cookie('disp'+this.id))){
this.style.display = disp;
}
}
).touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});
});

pxlcreations
05-24-2010, 04:31 PM
Works perfectly, thank you very much!

pxlcreations
05-24-2010, 04:45 PM
One more thing :D, I could save the text in certain boxes around the page if it was reloaded, correct? Say I had a box with text in it:


<input type="text"></input>

And I wrote "Fish" inside, I would get "Fish" after I reloaded.

jscheuer1
05-24-2010, 05:14 PM
For just a simple reload, most browsers do that automatically. But to have a better chance, yes you could use cookies. Your code for the input is incorrect though. it has no closing </input> tag. In HTML, you just leave it off, in XHTML you put a self closing tag:


<input type="text" />

So you just need a way of grabbing the value in a cookie and retrieving it. You could use an id:


<input id="text1" type="text" onchange="$.cookie(this.id, this.value);" />

Then in your document ready section:


$('#text1').val($.cookie('text1') || '');

pxlcreations
05-24-2010, 07:31 PM
So if I had multiple, it would be like this?


$().ready(function(){
setInterval(checkOrientAndLocation,1000);
$('.draggable').each(function(){
if($.cookie(this.id)){
var pos = $.cookie(this.id).split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
var disp;
if((disp = $.cookie('disp'+this.id))){
this.style.display = disp;
}
$('#text1').val($.cookie('text1') || '');
$('#text2').val($.cookie('text1') || '');
}
).touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});
});

jscheuer1
05-25-2010, 11:50 AM
Yes, but that would be redundant. Up until .touch(


$('.draggable').each

runs once for each draggable element. It would also be verbose coding, as you must make a separate:


$('#text1').val($.cookie('text1') || '');

and a separate:


onchange="$.cookie(this.id, this.value);"

for each input.

So, instead, let's give each input you want treated in this manner the same class:


<input class="remember" id="text1" type="text" />

Then we can do:


$().ready(function(){
setInterval(checkOrientAndLocation,1000);
$('.remember').each(function(){
var val;
if((val = $.cookie(this.id))){
this.value = val;
}
}
).change(function(){$.cookie(this.id, this.value);});
$('.draggable').each(function(){
if($.cookie(this.id)){
var pos = $.cookie(this.id).split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
var disp;
if((disp = $.cookie('disp'+this.id))){
this.style.display = disp;
}
}
).touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});
});

Which would all be a bit more efficient like so:


$().ready(function(){
var val, pos, disp;
setInterval(checkOrientAndLocation,1000);
$('.remember').each(function(){
if((val = $.cookie(this.id))){
this.value = val;
}
}
).change(function(){$.cookie(this.id, this.value);});
$('.draggable').each(function(){
if((pos = $.cookie(this.id))){
pos = pos.split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
if((disp = $.cookie('disp'+this.id))){
this.style.display = disp;
}
}
).touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});
});

I'm just getting a little concerned at the sheer number of cookies this could end up generating. See:

http://www.ghacks.net/2008/08/16/browser-cookie-limits/

What browser is that on iPad and iPhone? If it's Safari, and those figures are accurate (unlimited), there should be no problem. But also notice IE (50 after a patch, I read elsewhere that it's 20, presumably without the patch). I know there won't be IE on iWhatever, but if it is a special edition of Safari (perhaps with a lower cookie limit to save disk space), or is Firefox (which can have its cookie limit set quite low), or some other made for iWhatever browser, there could be problems.

pxlcreations
05-25-2010, 07:20 PM
Yeah, it's safari, and what's nice about the iPad is that it's only safari.

I tried the new code, and the info didn't stay, the new version is uploaded to the link I sent you. And it's on these lines where I have the onchange set up:


<textarea id="note" onchange="$.cookie(this.id, this.value);" class="remember" style="font-family:Marker Felt;width:215px;margin:10px;height:130px;border:0;background-color:transparent;font-size:20px;" name="i[]" rows="" cols="">Tap here to enter your note!</textarea>


<input type="text" onchange="$.cookie(this.id, this.value);" class="remember" id="win" name="win" value="0" style="-webkit-border-radius:5px;height:25px;width:170px;text-align:right;font-size:20px;font-weight:bold;border:2px solid #cccccc;background-image:url(images/apps/blue.png);background-repeat:repeat-x;" />

pxlcreations
05-26-2010, 12:13 AM
I'm sorry about being so vague on all my, "It's not working"... so let me clarify a bit.

I put this in my site.js file (the correct one)


$().ready(function(){
var val, pos, disp;
setInterval(checkOrientAndLocation,1000);
$('.remember').each(function(){
if((val = $.cookie(this.id))){
this.value = val;
}
}
).change(function(){$.cookie(this.id, this.value);});
$('.draggable').each(function(){
if((pos = $.cookie(this.id))){
pos = pos.split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
if((disp = $.cookie('disp'+this.id))){
this.style.display = disp;
}
}
).touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});
});

And then changed my input codes to something like this:


<input type="text" onchange="$.cookie(this.id, this.value);" class="remember" id="win" />

And I entered text in the box, reloaded the page, and the previous text was not there.

jscheuer1
05-26-2010, 02:57 AM
I was afraid of that. The onchange event is usually sufficient for things like this. But, since you are changing the value of the calculator without directly interacting with the text input, and because the sticky note is a textarea, not a text input, onchange may not be sufficient. I did test it out by actually entering data in such a way as that the onchange event would fire, and it appeared to work. I say 'appeared', because the browser will usually remember data for form elements on refresh anyway, so I cannot be sure whether it was that or the script.

Another thing here is that (if it had worked) for recording the data we only needed:


$('.remember').each(function(){
if((val = $.cookie(this.id))){
this.value = val;
}
}
).change(function(){$.cookie(this.id, this.value);});

or:


<input type="text" onchange="$.cookie(this.id, this.value);" class="remember" id="win" />

not both. The parts of the code that are not highlighted are still needed though. In the first block for retrieving the data on reload, the second block for rendering the element and allowing the retrieval code from the first block to recognize the input element.

OK, so let's try this - using the onunload event of the page. First, get rid of:


onchange="$.cookie(this.id, this.value);"

from the calculator 'win' input and the sticky note 'note' textarea. And change:


$().ready(function(){
var val, pos, disp;
setInterval(checkOrientAndLocation,1000);
$('.remember').each(function(){
if((val = $.cookie(this.id))){
this.value = val;
}
}
).change(function(){$.cookie(this.id, this.value);});
$('.draggable').each(function(){
if((pos = $.cookie(this.id))){
pos = pos.split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
if((disp = $.cookie('disp'+this.id))){
this.style.display = disp;
}
}
).touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});
});

to:


$(window).unload(function(){
$('.remember').each(function(){
$.cookie(this.id, this.value);
});
});
$().ready(function(){
var val, pos, disp;
setInterval(checkOrientAndLocation,1000);
$('.remember').each(function(){
if((val = $.cookie(this.id))){
this.value = val;
}
}
);
$('.draggable').each(function(){
if((pos = $.cookie(this.id))){
pos = pos.split('_');
$(this).css({position: 'absolute', top: pos[0], left: pos[1]});
}
if((disp = $.cookie('disp'+this.id))){
this.style.display = disp;
}
}
).touch({
animate: false,
sticky: false,
dragx: true,
dragy: true,
rotate: false,
resort: false,
scale: false
});
});

pxlcreations
05-26-2010, 11:31 AM
Thank you once again, the new script has worked! I think that's all of my questions on JS right now, but if I need some more help I'll shoot you a PM!