Positioning elements using MooTools
I've spent the afternoon creating a custom scrollbar for a products viewer which utilizes CSS transitions, reflections, and other goodness.
Simple arithmetic dictates how long to make the scrollbar and where to position it, but I could not get my theoretical calculations to play out in the browser.
It turns out that I'd been calling the wrong MooTools method. I'd been doing…
element.setStyle('left', offset);
rather than…
element.setPosition({ x: offset });
Frustratingly, setStyle('left', offset) appeared to work, but its behaviour
was unpredictable. I'm still confused by this, but at least I'm no longer
stuck.
Possibly related posts
- MooTools every method
- Auto-populating input fields with MooTools
- Python loops can have else clause?!
- Duplicating arrays in JavaScript
- Associative arrays in JavaScript