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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:10:37+00:00 2026-05-28T15:10:37+00:00

I’m trying to create a JQuery slider and I’ve hit a roadblock. I’m new

  • 0

I’m trying to create a JQuery slider and I’ve hit a roadblock. I’m new to both Javascript and JQuery however. Here is my code –

<!DOCTYPE html>
<html>
  <head>
    <title>Experimentation</title>
    <style type="text/css">

#container {
overflow: hidden;
height: 200px;
width: 200px;
}   

#box {
  width: 200px;
  height: 200px;
  background-color: gray;
  z-index: 10000;
  position: relative;
  }


#information {
  position: absolute;
  width: 200px;
  height:200px;
  background-color: black;
  opacity: 0.2;
  top: 150px;
  color: #FFF;
}

#information h3 {
 margin: 3px 3px; 
 text-align: center;
}

    </style>
    <script type="text/javascript" src="jquery-1.4.js"></script>
    <script type="text/javascript">
      var topInitial = "0";
      var topAfter = "150px";

      $(function() {

      /*
      $("#box").mouseover(function(){
      $("#information").css("top",topInitial); }); 


      $("#box").mouseout(function() {
      $("#information").css("top",topAfter); });      
      });
      */

      $("#box").mouseover(function() {  
      $("#information").animate({
      top: 0 }, "slow"); });

      $("#box").mouseout(function() {
      $("#information").animate({
      top: 150 }, "slow"); });

      //New Code
      $("#container").click(function() {
  $("#container").animate({
  margin-left: 30}, "slow"); });

     });
    </script>
  </head>

  <body>

  <div id="container">
  <div id="box">
  <div id="information">
  <h3> Criminal Penguins Having a Ball </h3>
  <p> You have never seen something like this before!</p>
  </div>
  </div>
  </div>

  </body>
</html>

My problem is, the mouseover event is happening many times. Can someone tell me how to rectify this issue? Another important query, since I’ve only begun to code I’m sure I’ll hit some roadblocks in the future as well. Should I then create a new thread with the modified code or will editing this thread work? Please help! 🙂

Update: I’ve just added some new code in my Javascript. I want to move the element to the right by 30px. Is this the way to accomplish this task?

  • 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-05-28T15:10:39+00:00Added an answer on May 28, 2026 at 3:10 pm

    Use mouseenter instead of mouseover. Mouse enter will be called once it enters the element.

    Change your function as below,

       $("#box").mouseenter(function() {  
          $("#information").animate({
            top: 0 }, "slow"); 
       });
    

    Also you can change your script like below,

      $("#box").mouseenter(function() {  
         $("#information").animate({
         top: 0 }, "slow"); 
      }).mouseleave(function() {
         $("#information").animate({
         top: 150 }, "slow"); 
      });
    

    You can read about all jQuery mouse events here

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm trying to create an if statement in PHP that prevents a single post
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I am trying to understand how to use SyndicationItem to display feed which is

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.