C
Carl Gilbert
Hi
I am trying to allow a user of a web site to move an image around the page
using draggable Divs. I have tried using some script from
http://www.mattkruse.com/.
In particular: http://www.mattkruse.com/javascript/dragiframe/ which caters
for draggable IFrames. I think I can use the same code for Divs but I have
no success as yet.
I have to following code but I can not work out what I am doing wrong.
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="ImageUpload.WebForm1"%>
<SCRIPT language=javascript src=dragiframe.js></SCRIPT>
<STYLE>.drag{position:absolute; cursor:hand;}</STYLE>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>WebForm1</TITLE>
</HEAD>
<!--<BODY onLoad="addHandle(document.getElementById('div1'), window);">-->
<BODY onLoad="addHandle(document.getElementsByTagName(Div).item(0),
window);">
<DIV id="div1" name="div1" class="drag"
style="width:30;height:30;top:200;left:200">
<IMG src=cross.gif>
</DIV>
</BODY>
</HTML>
Can anybody identify where I am going wrong or if I am missing anything?
Regards, Carl
Note: I have also downloaded dragiframe.js and placed it in the same folder
as the web page.
I am trying to allow a user of a web site to move an image around the page
using draggable Divs. I have tried using some script from
http://www.mattkruse.com/.
In particular: http://www.mattkruse.com/javascript/dragiframe/ which caters
for draggable IFrames. I think I can use the same code for Divs but I have
no success as yet.
I have to following code but I can not work out what I am doing wrong.
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="ImageUpload.WebForm1"%>
<SCRIPT language=javascript src=dragiframe.js></SCRIPT>
<STYLE>.drag{position:absolute; cursor:hand;}</STYLE>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>WebForm1</TITLE>
</HEAD>
<!--<BODY onLoad="addHandle(document.getElementById('div1'), window);">-->
<BODY onLoad="addHandle(document.getElementsByTagName(Div).item(0),
window);">
<DIV id="div1" name="div1" class="drag"
style="width:30;height:30;top:200;left:200">
<IMG src=cross.gif>
</DIV>
</BODY>
</HTML>
Can anybody identify where I am going wrong or if I am missing anything?
Regards, Carl
Note: I have also downloaded dragiframe.js and placed it in the same folder
as the web page.