473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Draggable Divs

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(Di v).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.
Jul 23 '05 #1
5 2561
Without knowing what's in dragiframe.js it's hard to know what the
problem is. Try adding position: absolute in your div to allow it to
actually be positioned anywhere.

Jul 23 '05 #2
Carl Gilbert wrote:
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/.

[...]

The script specifically looks for an IFRAME (see line 175).
You need to make it look for a div and manage the other parts of
the code that require an IFRAME not a div.

Maybe Matt is lurking?

Why not just use an IFRAME and be done with it?
--
Rob
Jul 23 '05 #3

http://www.mattkruse.com/scripts/sup...&LastLogin=You
could also try posting on Matt's forum. Maybe someone has already done
it:

Jul 23 '05 #4
Carl Gilbert wrote:
Hi

I am trying to allow a user of a web site to move an image around the page using draggable Divs.


(snip)

This is hard to beat (check out the "Optional Commands" in particular).

http://www.walterzorn.com/dragdrop/dragdrop_e.htm

Jul 23 '05 #5
> This is hard to beat (check out the "Optional Commands" in
particular).
http://www.walterzorn.com/dragdrop/dragdrop_e.htm

This is a great site. Thanks for the tip.

Carl

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: rdlebreton | last post by:
Hi, Folks! I've been trying to develop my own version of these draggable layers and I have been limiting myself to IE6...for now. I have looked at some other examples to get ideas of creating...
2
by: louissan | last post by:
Hi all, I have a slight problem with IE, when everything works with firefox. The goal is to _create_ boxes using the createElement method. And then making it draggable with the mouse. The code...
2
by: Sam Marrocco | last post by:
Is is possible to make vb.net controls such as a checkbox or button draggable while an app is running, thereby allowing the user to "re-design" the layout of buttons on a form? --...
0
by: Showjumper | last post by:
On pageflakes you can drag the panels around but they will snap to specific localtions. How can i do this using the dragoverlayextenders and ATLAS? Right now i have it so the panels are draggable...
3
by: Jason | last post by:
I have a hyperlink that is draggable (using Prototype's "new Draggable()" construct). I want to be able to drag the link without actually 'clicking' the link once i end the drag. Is there a way to...
1
by: tehweb | last post by:
Background: I have a fixed position div on the bottom om my page. I have then added a dialog-div into this fixed position one. When I bring up the dialog, everything works if the the scrollTop is...
3
by: Sebarry | last post by:
Hi, I have been assigned the daunting task of applying coordinate movements of a draggable div with a small box to the scrolling of the current window. Basically the small box represents the...
6
by: vunet | last post by:
Hello, I hope this is a right place to ask about Scriptaculous library. I started using draggable and droppables effects for the first time and my draggable is simply initialized as new...
6
by: cleary1981 | last post by:
I have adapted code from http://dunnbypaul.net/js_mouse/ I want to use a button to create new draggable divs but i keep getting error "is null or not an object" heres the code <html> <head>...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.