Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7804469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:55:31+00:00 2026-06-02T01:55:31+00:00

I have searched STACKOVERFLOW and other forums for the solution to my problem –

  • 0

I have searched STACKOVERFLOW and other forums for the solution to my problem – if I have missed a working solution please point me towards it.

My Problem:
Whenever dragging an element (a portlet div) in my sortable list, I need to perform some action BEFORE the actual drag process starts (From what I understand before the START event is fired).

To be more specific:
My DIVs provide the user with the possibility to extend/collapse it´s body (like in the example seem at the jquery UI page http://jqueryui.com/demos/sortable/#portlets).

Whenever dragging an element I´d like to trigger my collapse method so that the only visual element being dragged is the collapsed DIV.

However whenever I call my method (something like this)

$someitem.trigger("toggle.somenamespace") 

it works as expected, except that the HEIGHT of the dragged helper gets calculated BEFORE the start event is fired in the sortable and therefore the helper has the height of the original element in its un-collapsed state.

My original thought on this was: as the sortable has e.g. the possibility the measure a drag distance before the actual drag procedure starts (with the option: distance) it should be possible hook into this flow, for example storing the original startDrag function (or whatever it is called) of the sortable widget in a temporary var, override it with a custom callback which first triggers my collapse functionality and then calls the original function to ensure that the height is calculated correctly.
However – I did not have much success with this approach so far…

Please note that setting CSS properties in the handlers for the drag or over an event of the sortable has not the desired effect, as the height the sortable widget calculated for the helper is set as element properties.

Or – probably someone knows a better way to affect the height of the helper being displayed during the drag process, it´s just my opinion that my original approach (changing the element before the drag process and then let the widget do its calculations the way it was intented) would be a better solution…

thanks for any assistance,
Matthias

EDIT:
Setting the sortable flag: forceHelperSize to true and setting the ui.item / helper size in the start draghandler does not work either, as it results in the desired effect visually (only the collapsed item is dragged, but stops the element from being dragged down all the way (as if the item would still have the height in its un-collapsed state)
tested with a helper: ‘original’ and ‘clone’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:55:33+00:00Added an answer on June 2, 2026 at 1:55 am

    I’ve searched a long time for this “solution”:

    $('.handle').each(function() {
        $(this).mousedown(function() {
            $(this).parent().parent().children('ol').hide('blind', 500);
        });
    });
    

    You can trigger a event by mousedowning the handle and hide whatever you want. Then set the option delay of the sortable to a value greater than the duration of the hiding animation, in my example 501.

    It’s not a elegant solution, but it works – at least in my program.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched around Google and StackOverflow trying to find a solution to this,
I have searched for hours now and haven't found a solution for my problem.
I have searched/Googled around but I'm struggling with the following problem. I am building
I have searched a lot but not able to find particular solution. There are
I have searched the stackoverflow site to find if someone has recommended any good
I have searched internet and stackoverflow thoroughly, but I haven't found answer to my
I have searched the Internet and stackoverflow.com, but got nothing. Who can give me
I have searched through stackoverflow and has found similar question. As I am still
Is there a recommended javascript code obfuscation tool? I have searched it in stackoverflow,and
I have been working using openFrameworks, on a problem that is posted on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.