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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:03:01+00:00 2026-06-11T09:03:01+00:00

Why if (//change b position) part write after (//show a list) part can’t work,

  • 0
  1. Why if (//change b position) part write after (//show a list) part can’t work, have some error?

  2. How can I make it so that when (.a-1).hover, (.b) not move and still in the same place after last change?
    +0 can’t work?

http://jsfiddle.net/sL8mK/

jquery

    //change b position
$(".a").hover(function(){
    var newleft = $(".b").position().left + 200;
    $(".b").css('left', newleft + 'px');
},function(){
    var newleft = $(".b").position().left - 200;
    $(".b").css('left', newleft + 'px');
});
$(".a-1").hover(function(){
    var newleft = $(".b").position().left + 0;
    $(".b").css('left', newleft + 'px');
},function(){
    var newleft = $(".b").position().left + 0;
    $(".b").css('left', newleft + 'px');
});

//show a list
$(".a").hover(function(){
    $(".a-1, .a-2").show();
},function(){
    $(".a-1, .a-2").hide();
});
$(".a-1").hover(function(){
    $(".a-1, .a-2").show();
},function(){
    $(".a-1, .a-2").hide();
});
$(".a-2").hover(function(){
    $(".a-1, .a-2").show();
},function(){
    $(".a-1, .a-2").hide();
});

html,css

<div class="a">a</div>
<div class="a-1">a-1</div>
<div class="a-2">a-2</div>
<div class="b">b</div>

.a{
position: absolute;
left: 100px;
top: 150px;
width: 105px;
background: red;
}
.a-1{
position: absolute;
left: 200px;
top: 150px;
width: 100px;
background: maroon;
display: none;
}
.a-2{
position: absolute;
left: 300px;
top: 150px;
width: 100px;
background: olive;
display: none;
}
.b{
position: absolute;
left: 200px;
top: 150px;
width: 100px;
background: blue;
}
  • 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-11T09:03:02+00:00Added an answer on June 11, 2026 at 9:03 am

    I’ve modified your code a bit – http://jsfiddle.net/ga5Um/1/
    (added a container div)

    Is this a solution for you?

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

Sidebar

Related Questions

For some reason, I can not seem to change the default position of an
I have an application (RoR 3.1) where a user can change the position of
How can I change the position of view through code? Like changing its X,
is it possible to change the left position of a div after dropping it?
In my rails app, I want to have a sortable list as part of
I have some Bruker NMR spectra that i am using to create a program
I'm trying to write a script that can control different windows from different programs
I'm using an AJAX request to handle some part of my app that deals
I have some xml that looks like this: <rootElement attribute=' > '/> This is
Background I have been asked to write a script that will create a vertical

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.