EDIT: Solved
Ok, my problem is that I need to find a way to constantly read x,y coordinates of the cursor in my browser onmousedown and then to quit reading the x,y coordinates onmouseup here is what I have so far
var mouseDown = 0;
var xPos = 0;
var yPos = 0;
document.body.onmousedown = function() {
mouseDown = 1;
}
document.body.onmouseup = function() {
mouseDown = 0;
}
function resize(width, height){
document.getElementById('component1').width=width;
document.getElementBYId('component1').height=height;
}
function setSize(){
while(mouseDown == 1)
{
xPos = event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
yPos = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ?
document.documentElement.scrollTop : document.body.scrollTop);
resize(xPos, yPos);
}
}
any suggestions?