Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Script.aculo.us Drag n' Drop issue
Old 05-16-2007, 02:46 AM Script.aculo.us Drag n' Drop issue
Extreme Talker

Posts: 196
Trades: 0
I am using the drag and drop script found here, http://script.aculo.us/. Yes i know its a hog. Anyways, i am using the script pretty much out the box with link in the sortable div. My issue is that when clicking on a link, if you at all move the mouse, its sorts to the direction you ever so slightly moved. This is driving me nuts. I have tried to add pausing functions here and there trying to create a couple millisecond pause before dragging so the click can take effect, but i have had no luck.

Can anyone suggest a way to alter the script, so that if i click on the link in the div, it wont drag before the href is called. Thanks. Here's my example code.

Code:
<div id="page">

    <?php /*   div sits in a TD cell. div ID can be anything alphanumeric. HTML inside DIV is ok.  */ ?>
    <div id="group" class="section">
        <h3 class="handle">Group 1</h3>

        <?php /*   div ID can be anything alphanumeric, after *item_*. HTML inside DIV is ok.  */ ?>
        <div id="item_1" class="lineitem"><a href="index.php">Item 1</a></div>
        <div id="item_2" class="lineitem"><a href="index.php">Item 2</a></div>
        <div id="item_3" class="lineitem"><a href="index.php">Item 3</a></div>
        <div id="item_4" class="lineitem"><a href="index.php">Item 4</a></div>
        <div id="item_5" class="lineitem"><a href="index.php">Item 5</a></div>
    </div>
</div>

<script type="text/javascript">
    // <![CDATA[

    /*   add each ID from group level div.   */
    sections = ['group'];

    /*   this watches for event changes like drag and drop action   */
    Event.observe(window,'load',init,false);
    function init() {

        /*   add a sortable.create for each group level div   */
        Sortable.create('group',{tag:'div', dropOnEmpty: true, containment: sections, only:'lineitem'});
    }

    /*   add sortable.create for *page* div   */
    Sortable.create('page',{tag:'div',only:'section',handle:'handle'});
    // ]]>
</script>
empiresolutions is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Script.aculo.us Drag n' Drop issue
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.37587 seconds with 12 queries