mootools-more

How to detect when an element over another element in JavaScript?

安稳与你 提交于 2019-12-21 12:31:55
问题 I wrote most of the code... And when the element is "fully" over the other element it works. The problem is that I don't just want it to be true when the element is "fully" over the element, I also want it to be true when the element is partly over the other element. Here is my code: element = this.element.getStyles('left', 'top', 'width', 'height'); elementLeftX = element.left.toInt(); elementLeftY = element.top.toInt(); elementRightX = (element.width.toInt() + element.left.toInt());

How do I include all children of a DOM element to be dragged using the Sortable plugin for MooTools?

别来无恙 提交于 2019-12-11 05:20:34
问题 I am using mootools-more.1817.js ...this is my HTML structure: <ul id="categories"> <div id="admin">Admin Controls</div> <li class="selected"><a href="#">Test</a> <ul> </ul> </li> <div id="admin">Admin Controls</div> <li><a href="#">Test 2</a> <ul> </ul> </li> <div id="admin">Admin Controls</div> <li><a href="#">Top Links</a> <ul> <li id="article"><a href="/1">Link 1</a></li> <li id="article"><a href="/3">Link 2</a></li> <li id="article"><a href="/2">Link 3</a></li> <li id="article"><a href="

How to detect when an element over another element in JavaScript?

送分小仙女□ 提交于 2019-12-04 07:33:23
I wrote most of the code... And when the element is "fully" over the other element it works. The problem is that I don't just want it to be true when the element is "fully" over the element, I also want it to be true when the element is partly over the other element. Here is my code: element = this.element.getStyles('left', 'top', 'width', 'height'); elementLeftX = element.left.toInt(); elementLeftY = element.top.toInt(); elementRightX = (element.width.toInt() + element.left.toInt()); elementRightY = (element.top.toInt() + element.height.toInt()); el = this.positions ? this.positions[i] : this