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

  • Home
  • SEARCH
  • 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 8716601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:07:20+00:00 2026-06-13T06:07:20+00:00

I’m new to jquery, so I do apologise if I don’t see the obvious

  • 0

I’m new to jquery, so I do apologise if I don’t see the obvious in what I am trying to achieve.

I have added 6 images and arranged them one on top of the other. What i would like to happen is when a user drags the top image away, it reverts back to the stack but at the bottom of the pile.

this is what I have to far:

<div id=”pinboard”>
 <ul>
 <li class="img"><img src="images/chalet.jpg" /></li>
 <li class="img"><img src="images/girl.jpg" /></li>
 <li class="img"><img src="images/iceland.jpg" /></li>
 <li class="img"><img src="images/ice.jpg" /></li>
 <li class="img"><img src="images/sail.jpg" /></li>
 <li class="img"><img src="images/whitemountains.jpg" /></li>
 </ul>
</div>



.img{
 list-style-type: none;
 position: absolute;
 -webkit-box-shadow: 0px 0px 10px #000;
 -moz-box-shadow: 0px 0px 10px #000;
 box-shadow:        0px 0px 10px #000;
 -webkit-transition:0.2s -webkit-transform linear;
 -moz-transition: 0.2s -moz-transform linear;
 transition:    0.2s transform linear;
 padding:15px 15px 40px 15px;
 background-color:white;

}

.ui-draggable-dragging {
 -webkit-transform: rotate(0deg) scale(1.2) !important;
 -moz-transform: rotate(0deg) scale(1.2) !important;
 -ms-transform: rotate(0deg) scale(1.2) !important;
 -o-transform: rotate(0deg) scale(1.2) !important;
 transform: rotate(0deg)     scale(1.2) !important;}




$('li').each(function(){
 xpos = Math.floor(Math.random()*920);
 ypos = Math.floor(Math.random()*420);
 rotation = Math.floor(Math.    random()*15);

 var rNum = (Math.random()*20)-2;  
  $(this).css( {   
    '-webkit-transform': 'rotate('+rNum+'2deg)',
    '-moz-transform': 'rotate('+rNum+'2deg)'
 });

}).draggable({revert: true});

I have tried using droppable, draggable, sortable in various ways. I have also tried using the zindex to change the position.

any help with this is greatly appreciated.

many thanks

  • 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-13T06:07:22+00:00Added an answer on June 13, 2026 at 6:07 am

    There are probably better ways to do this.
    I used some css’ing to do the trick: see here

    For future ref (in case there’s no more fiddle):

    $('.img').draggable();
    $('.img').on('mouseup',function(){
        $(this).hide();
        var zI = $(this).css('z-index');
        if (zI == 1){
            var restart = 2;
            $('.img').css('z-index', restart);
            zI = restart;
        }
        $(this).css({
            'position': 'absolute',
            'left': '0px',
            'top': '0px',
            'z-index': zI-1
        });
        console.log(zI);
        $(this).show();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am using JSon response to parse title,date content and thumbnail images and place
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.

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.