Skip to content

Instantly share code, notes, and snippets.

@bebraw
Created October 17, 2010 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bebraw/630800 to your computer and use it in GitHub Desktop.
Save bebraw/630800 to your computer and use it in GitHub Desktop.
var draggable = new Draggable(this.options.id, {
handle: header,
range: {x: [0, window.innerWidth], y: [0, window.innerHeight]} });
draggable.oldStyle = $(this.options.id).get('style').cssText;
draggable.onStop(function() {
var top = this.element.getStyle('top');
var left = this.element.getStyle('left');
var width = this.element.getStyle('width');
var zIndex = this.element.getStyle('z-index');
this.element._.setAttribute('style', this.oldStyle);
this.element.setStyle({top: top, left: left, width: width,
'z-index': zIndex});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment