This class allows for elements to be dragged using percent-based units. The units are calculated based on the element/container ratio.
Usage is the same as Drag except with an additional argument in the constructor defining the element's container.
Options:
Events:
Usage:
var element = document.id('element'), container = document.id('container'), options = {'auto_resize': false}, drag = new Drag.Percent(element, container, options);
If your element or container will resize, simply call the defineScale method after the resizing.
element.setStyle('width', '50%'); drag.defineScale();
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus