bonesbrigade
11-14-2008, 03:03 AM
1) Script Title: DOM Drag & Drop Script
2) Script URL (on DD): DOM drag and drop (http://www.dynamicdrive.com/dynamicindex11/domdrag/index.htm)
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:
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
}
When I just have the code without the if statement:
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
it works fine, so I am thinking maybe I have a syntax error or something.
2) Script URL (on DD): DOM drag and drop (http://www.dynamicdrive.com/dynamicindex11/domdrag/index.htm)
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:
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
}
When I just have the code without the if statement:
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
it works fine, so I am thinking maybe I have a syntax error or something.