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 8017227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:46:56+00:00 2026-06-04T20:46:56+00:00

I want a list Item 1 up Item 2 up that will be shortable

  • 0

I want a list

Item 1 up
Item 2 up

that will be shortable and when you drag item 2 to make the green div come above the red div. meaning is z-index will be higher!

is my link to see it working so far..
http://jsfiddle.net/2vgRY/

Thanks guys in advance!

EDIT:

just one last thing! when i place a 3rd item and place it above the 2nd i want the first one to still be on the top then the 3rd, then the 2nd.. http://jsfiddle.net/2vgRY/3/

its like a sorting thing , you draf item 3 up then div 3 comes up, you drag item 2 bellow item 1 then div 1 is first then div 2 bellow it then div 3 last ..

  • 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-04T20:46:59+00:00Added an answer on June 4, 2026 at 8:46 pm

    If I’ve understood your question correctly, you can use jQuery UI sortable() start event:

    See this working Fiddle Example!

    JQUERY

    $(function() {
        $( "#sortable" ).sortable({
            start: function(event, ui) {
                // clear z-index
                $('span[class^="target_"]').css({
                    "z-index" : '0'
                });
    
                // bring up the target
                var item = ui.item.attr('class').split(' ')[0];
                $('.' + item.replace("item", "target")).css({
                    "z-index" : 10000
                });
            },
        });
    
        $( "#sortable" ).disableSelection();
    });
    

    HTML

    <ul id="sortable">
      <li class="item_1 ui-state-default">
        <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 1 up
      </li>
      <li class="item_2 ui-state-default">
        <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 2 up
      </li>
    </ul>
    <span class="target_1" style="background:red;padding:30px; position:absolute; float:left;">1</span>
    <span class="target_2" style="background:green; padding:30px; margin-left:10px; position:absolute; float:left;">2</span>
    

    Note that I’ve added the class item_x and the class target_x to allow the elements identification.

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

Sidebar

Related Questions

I have a droppable-List and I want that the Item will while dragging be
I want to make it so the item I have selected in the list
I want to display a list item that says More at the end of
When a list item is added to a sharepoint list i want to redirect
After ul tag i want to call function in javascript to add list item
I created a customized CursorAdapter and want to select a list item, in order
I want to sort a list by each item's digit. Example: myCmpItem = '511'
I want to change the property of just a single item in a list
I have a list of items: <item>a</item> <item>x</item> <item>c</item> <item>z</item> and I want as
I have a std::list of boost::shared_ptr<T> and I want to remove an item from

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.