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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:23:21+00:00 2026-06-06T09:23:21+00:00

i have animated div in html. it is adding 1px to div in every

  • 0

i have animated div in html. it is adding 1px to div in every second, now i want if my div’s right position reach 15 then one alert box should say “hiii”. i have made a small function but it is not working.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<style>

.wrap { border:solid 1px #F00; width:1000px; height:300px; overflow:hidden; position:relative}

.box { width:200px; height:200px; background:#00F; position:absolute}
</style>


<script type="text/javascript" src="jquery-1.7.2.js"></script>

<script type="text/javascript">


var left=5; 

$(function aniMation(){




    $('.box').css({right:++left})
    setTimeout(aniMation,1000)  

    })



$(function (){

    var box= $(".box").css("right")

    if(box=="10px"){

        alert("hiii")

        }


    })





</script>


</head>


<body>

<div class="wrap">

<div class="box"></div>

</div>

</body>
  • 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-06T09:23:22+00:00Added an answer on June 6, 2026 at 9:23 am

    I don’t think you’re actually calling that function other than on page load!

    From the docs:


    jQuery( callback )

    A shorthand for $(document).ready().
    Allows you to bind a function to be executed when the DOM document has finished loading.


    I’ve checked the lines you call in the Console of my browser (Google Chrome) and they seem to work. The problem is that the function is only executed once on page load, which is before the check is true.

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

Sidebar

Related Questions

I have the code below working like a charm: var div = $('#div'); div.html('<div>one
I have an animated div placed inside a div, I only want this div
I have the following setup: <div>Element with CSS3 animated height change</div> <div><a href=#>Link</a></div> I
I have a animated GIF that I want as a watermark. How do I
I have an animated game which is generally achieving 25-30 frames per second, though
I am currently trying to unhide a DIV and then right after scroll down
In my HTML for my file I have a div with the id divNavyBox.
Currently I have the code: <!-- More html code above --> <div id="loading" style="display:
I have four div s which are animated using size, height and positions; that
I have a slider that when clicked, animates a div vertically, then goes back

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.