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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:19:10+00:00 2026-06-09T15:19:10+00:00

I know that the question is confusing but let me explain what I’m trying

  • 0

I know that the question is confusing but let me explain what I’m trying to achieve.

Say i have the following css and html.

<style>  
   body{ height: 10000px;}  
   #revolve{ border: 1px solid red; width: auto; height: auto;}  
</style>

<body>  
  <div id="revolve">  
    <ul>  
      <li> one </li>  
      <li> two </li>  
      <li> three </li>  
    </ul>
  </div>
</body>

Because the body is set to ten thousand pixels, on a normal use of the scroll wheel the whole page would scroll down as normal.

I want to be able to change the position of the < ul> elements such that when the mouse cursor is over the “revolve” div element, to use the scroll wheel to swapt the position of the elements rather than scrolling the 10000px page. I also need all my < li> elements to be visible at all time and the div to be able to accommodate any other < li> elements if needed.

(eventually my desired result would be in the following order of < li> elements)

<li>  two </li>  
<li>  three </li>  
<li>  one  </li>

Now setting the div element to a certain height and “overflow: scroll;” wont give me the result I want. I thought of a long and complicated way to do it, but maybe there is someone experienced who can show me a nice and elegant way to achieve it.

  • 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-09T15:19:11+00:00Added an answer on June 9, 2026 at 3:19 pm

    you can try position: fixed; top: 20px; left: 20px; inside #revolve, to keep on the page all the time
    Let me show you as below in example,

    <style>  
       body{ height: 10000px;}  
       #revolve{ position: fixed; top: 20px; left: 20px; border: 1px solid red; width: auto; height: auto;}  
    </style>
    
    <body>  
      <div id="revolve">  
        <ul>  
          <li> one </li>  
          <li> two </li>  
          <li> three </li>  
        </ul>
      </div>
    </body>
    

    you can use jQuery function to change position of <li> as below

    You can use jQuery’s .after() for moving elements around. I cloned one of them so the original can remain as a placeholder. It’s like if you wanted to switch variables a and b, you’d need a third temporary variable.

    $.fn.exchangePositionWith = function(selector) {
        var other = $(selector);
        this.after(other.clone());
        other.after(this).remove();
    };
    

    your code would be: $("#revolve ul li:eq(1)").exchangePositionWith("#revolve ul li:eq(3)");

    i hope this would help.

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

Sidebar

Related Questions

Maybe a silly question but here goes anyway. Example: Let's say I have one
I know the title is bit confusing for my question. Let me explain:- There
I know the title is bit confusing for my question. Let me explain:- There
Before somebody points me to that question, I know that one can't parse html
I know that this question must have been asked and answered a million times,
I know that this sort of question has been asked here before, but still
I have a simple question that is confusing me. Goal : I want to
Maybe the title is confusing, but I didn't know how to explain my doubt.
Ok, I know that question is not very informative.. Someome feel free to change
I know that this question had already been asked a couple of times before,

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.