User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 422,901 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,194 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1257 | Replies: 5
Reply
Join Date: Sep 2006
Posts: 89
Reputation: scorpionz is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster in Training

Dragging Div on Browser and show its Position

  #1  
May 24th, 2008
Hi
this is scorpionz
The reason of this thread is that:
I am making a Drag Div by mouse, and showing its position to the browser in (x,y ) coordinates, like when user click the box and drag it to some other place, then it shows the position of that point, i have research on the Internet, visited many website, but unable to find the right solution, like i founfd some Drag div but not finding the location, or i have found one of the example, which is working fine in FireFox but not working fine in IE.
So these are the problems i am facing,

Any Response back to this will be higly appreciated
I will be Thankful to that person as well

Thanks and Regards
ScorpionZ
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,851
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 344
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: Dragging Div on Browser and show its Position

  #2  
May 24th, 2008
Post the *relevant* code which is not working; it's probably one of those browser incompatibility issue you are facing there which is very much solvable.
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Join Date: Sep 2006
Posts: 89
Reputation: scorpionz is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster in Training

Re: Dragging Div on Browser and show its Position

  #3  
May 24th, 2008
Well as far as that code is concern its little complicate to embed here

Can you please Provide some website address where this thing is already in running mode?
My desire actual Solution?

Thanks for your response

Regards
scorpionz
Reply With Quote  
Join Date: Sep 2006
Posts: 89
Reputation: scorpionz is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster in Training

Re: Dragging Div on Browser and show its Position

  #4  
May 28th, 2008
http://developer.yahoo.com/yui/examp...rop/index.html

Considering reference to this Website
In fact there are so many examples like this.... U agree that?

I have visited many website...
But many problems occurs in Function, By applying that whole component to our application
It will some how Problem occurs in confliction of Funtion

If i want to that by scratch learning those techniques...., So Let me have it step by step to get to the end

Just considering this example in our thread

<html>
<head>

<script type="text/javascript">
</script>
</head>
<body>
<div style='border-width:1px;border-color:#C0C0C0;border-style: solid;background-color:#C0C0C0;width:540px;'>

X coordinate:<textarea id="mytextarea"> </textarea>

Y coordinate:<textarea id="mytextarea2"> </textarea>

</div>
&nbsp;
<div id="mydiv" onclick="get_id()" style='border-width:1px;border-color:#C0C0C0;border-style: solid;background-color:#C0C0C0;width:130px;'>
<a href="#" id="src" onclick="get_val()">ScorpionZ</a>
</div>

As you are already familiar with this sample
Now what to apply to drag this Div with href inside that and store its Coordiantes....
I want to do it with Simple Javascript but i found ambigous JS at many places, some time get difficult to understand, So if i move that , It show X coordinates at Text 1 and Y at Text 2

Hope I clear the scenario in Detail

Hoping for the Best Responses

Thanks and Regards
ScorpionZ
Reply With Quote  
Join Date: Aug 2006
Location: Noida, India
Posts: 158
Reputation: Luckychap is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 17
Luckychap's Avatar
Luckychap Luckychap is offline Offline
Junior Poster

Re: Dragging Div on Browser and show its Position

  #5  
May 28th, 2008
Hi,

I am also making a class in javascript to drag any div on the web page. But for cross-browser I am using one javascript file from YUI that is yahoo-dom-event.js. In this file there are many function to peform these task
When you think you have done a lot, then be ready for YOUR downfall.
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,851
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 344
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: Dragging Div on Browser and show its Position

  #6  
May 28th, 2008
If the only problem you are facing is grabbing hold of the mouse coordinates, try the Event properties article at quirksmode.
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 1:13 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC