1) Script Title: DOM Drag & Drop Script
2) Script URL (on DD): DOM drag and drop
3) Describe problem: I can't seem to get the drag end coordinates to work in a simple if statement. Do I have bad syntax or something? Here is my code:
When I just have the code without the if statement:Code:var fdThumb = document.getElementById("fd"); Drag.init(fdThumb, null, 0, 720, 0, 315); fdThumb.onDragEnd = function(x, y) if(x <= 720 && x >= 670 && y <= 160 && y >= 30){ alert('x: ' + x + ' y: ' + y);//just to see if it works }
it works fine, so I am thinking maybe I have a syntax error or something.Code:var fdThumb = document.getElementById("fd"); Drag.init(fdThumb, null, 0, 720, 0, 315); fdThumb.onDragEnd = function(x, y) alert('x: ' + x + ' y: ' + y);//just to see if it works



Reply With Quote

Bookmarks