Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Drag and Drop problems
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mike  
View profile  
 More options Jun 30, 1:58 am
From: Mike <thej...@gmail.com>
Date: Mon, 29 Jun 2009 22:58:50 -0700 (PDT)
Local: Tues, Jun 30 2009 1:58 am
Subject: Drag and Drop problems
I am making a drag-and-drop editor thing using scriptaculous. However,
when I dynamically add an element, it takes the size of the div it is
being placed into. Then, when I drag it, I don't have access to any
other elements that are already in the div.

Here is the javascript functions I created:

               function createCanvas(){
                        Droppables.add('sigImage', {
                                accept: 'draggable',
                                hoverclass: 'hover'
                        });
                }
                function createNewDraggable(elementId){
                        new Draggable(elementId, {
                                handle: 'sigImage',
                                ghosting: true
                        });
                }
                function newElementMenu(){
                        document.getElementById('newElementName').value = '';
                        Effect.Appear('createNewElementMenu', {duration: .3});
                }
                function newElement(elementName){
                        Effect.Fade('createNewElementMenu', {duration: .3});
                        document.getElementById('sigImage').innerHTML += '<div id="' +
elementName + '">The next element!</div>';
                        createNewDraggable(elementName);
                }

Here is the nesting:

                <div id="sigImage" style="width: 500px; height: 100px;
background-color: gray; color: black; border: 1px black; overflow:
none;">
                        <div id="dragme">Drag me!</div>
                </div>

Another not so important thing is how can I get the elements to remain
in the div and not be dragged outside of it?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
david  
View profile  
 More options Jun 30, 6:29 am
From: david <david.brill...@gmail.com>
Date: Tue, 30 Jun 2009 03:29:36 -0700 (PDT)
Local: Tues, Jun 30 2009 6:29 am
Subject: Re: Drag and Drop problems
Hi Mike,

for the first question, I think that you should style the inserted
element or use a SPAN tagb instead of a DIV tag:
the DIV expand its width by default to it's contener width,
the SPAN just enclose inside content.

for the second question, there is no siimple way, scriptaculous don't
handle that, but I remember that some projects have modify default
scriptaculous behaviour ==> Have a look at http://scripteka.com/

--
david

On 30 juin, 07:58, Mike <thej...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex McAuley  
View profile  
 More options Jun 30, 7:16 am
From: "Alex McAuley" <webmas...@thecarmarketplace.com>
Date: Tue, 30 Jun 2009 12:16:08 +0100
Local: Tues, Jun 30 2009 7:16 am
Subject: Re: [Proto-Scripty] Re: Drag and Drop problems
For the second question you have to work out its positioning on the page and
relative to its parent... enclosing is not easy but its also not difficult
...

Here is some code i wrote to enclose draggable windows in my windowing
system to make sure they dont go outsode the page...

http://pastie.org/529198

HTH

Alex


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick Waldron  
View profile  
 More options Jun 30, 12:10 pm
From: Rick Waldron <waldron.r...@gmail.com>
Date: Tue, 30 Jun 2009 12:10:05 -0400
Local: Tues, Jun 30 2009 12:10 pm
Subject: Re: [Proto-Scripty] Re: Drag and Drop problems

Alex,

Thats super rad.

Rick

On Tue, Jun 30, 2009 at 7:16 AM, Alex McAuley <


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike  
View profile  
 More options Jun 30, 12:26 pm
From: Mike <thej...@gmail.com>
Date: Tue, 30 Jun 2009 09:26:26 -0700 (PDT)
Local: Tues, Jun 30 2009 12:26 pm
Subject: Re: Drag and Drop problems
Thank you all for the fast responses. That really helps my project
along :)

On Jun 30, 9:10 am, Rick Waldron <waldron.r...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex McAuley  
View profile  
 More options Jun 30, 2:14 pm
From: "Alex McAuley" <webmas...@thecarmarketplace.com>
Date: Tue, 30 Jun 2009 19:14:22 +0100
Local: Tues, Jun 30 2009 2:14 pm
Subject: Re: [Proto-Scripty] Re: Drag and Drop problems

Seriously ? ... lol

It needs everything to be in a "container" div with width and height set to the viewport but it works perfectly .... i wrote one for resizzables too to stop someone resizing something outside of a given container!.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike  
View profile  
 More options Jul 9, 1:47 pm
From: Mike <thej...@gmail.com>
Date: Thu, 9 Jul 2009 10:47:23 -0700 (PDT)
Local: Thurs, Jul 9 2009 1:47 pm
Subject: Re: Drag and Drop problems
Alright, I am having some new troubles. I changed the elements to
SPAN's, but now when a new element appears, the previous elements
become un-draggable. Why is this happening?

On Jun 30, 11:14 am, "Alex McAuley" <webmas...@thecarmarketplace.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google