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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:02:07+00:00 2026-06-17T07:02:07+00:00

So this question will probably get downvoted but I figure someone might be able

  • 0

So this question will probably get downvoted but I figure someone might be able to help.

The effect I am looking for is the blue block hovering up and down like a balloon, and the shadow growing and shrinking beneath it, as the block goes up and down, on a loop.

enter image description here

Any ideas on how to program this, or is anyone aware of a tutorial/plugin that might accomplish?

  • 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-17T07:02:08+00:00Added an answer on June 17, 2026 at 7:02 am

    You can do it with jQuery or either with CSS3, your call, I’ll show you both:

    CSS3 demo

    CSS3:

    #box{
      position:absolute;
      top:100px;
      left:0;
      width:200px;
      height:200px;
      background:#6CB8E9;
         -moz-animation:jump 2s infinite ease-in-out;
      -webkit-animation:jump 2s infinite ease-in-out;
    }
    
    #shadow{
      position:absolute;
      top:290px;
      height:20px;
      border-radius:30px;
      left: -200px;
      background:transparent;
      width:200px;
      box-shadow:200px 0 10px 2px rgba(0,0,0,0.4);
      margin-left:0;
      opacity: 1;
         -moz-animation:shadowSize 2s infinite ease-in-out;
      -webkit-animation:shadowSize 2s infinite ease-in-out;
    }
    
    @-moz-keyframes jump {
        0%   { top:100px;}
        50%  { top:25px;}
        100% { top:100px;}
    }
    @-webkit-keyframes jump {
        0%   { top:100px;}
        50%  { top:25px;}
        100% { top:100px;}
    }
    
    @-moz-keyframes shadowSize {
        0%   { width:200px; margin-left:0px; opacity:1;   box-shadow:200px 0 10px rgba(0,0,0,0.7);}
        50%  { width:150px; margin-left:25px;opacity:0.3; box-shadow:200px 0 30px rgba(0,0,0,0.3);}
        100% { width:200px; margin-left:0px; opacity:1;   box-shadow:200px 0 10px rgba(0,0,0,0.7);}
    }
    @-webkit-keyframes shadowSize {
        0%   { width:200px; margin-left:0px; opacity:1;   box-shadow:200px 0 10px rgba(0,0,0,0.7);}
        50%  { width:150px; margin-left:25px;opacity:0.3; box-shadow:200px 0 30px rgba(0,0,0,0.3);}
        100% { width:200px; margin-left:0px; opacity:1;   box-shadow:200px 0 10px rgba(0,0,0,0.7);}
    }
    

    Now, with our dear jQ… just use a .png image for the shadow instead of my ugly box-shadow 🙂

    jQuery demo

    var li = 1; // a LoopIterations variable
    
    function loop(){  
      
        li = ++li%2;  // reset evenly to '0' // results in 0, 1, 0, 1, 0, .... 
      
      $('#shadow').animate({
          width:       !li ? 150:200 ,
          marginLeft:  !li ? 25:0 ,
          opacity:     !li ? 0.3:1
      }, 2000);
      
      $('#box').animate({
        top:        !li ? 25 : 100
      },2000, loop);   // THIS 'loop' callback will recall the loop() function creating ... a loop :D
          
    }
    
    loop(); // start loop
    

    To explain:
    On every odd iteration li will be set to 0, and on every other to 1 thanks to % (Modulo operator).
    0 in Javascript can be represented as false, great for the use of a ternary operator that will check for two Boolean values e.g:
    [true or false statement] ? [do this if true] : [do that if false] ;

    !li ? 150:200 means if !li (= 0 = is false) use 200 else use 150

    Additionally:

    <div id="box"></div>
    <div id="shadow"></div>
    

    and CSS:

    #box{
      position:absolute;
      top:100px;
      width:200px;
      height:200px;
      background:#6CB8E9;
    }
    
    #shadow{
      position:absolute;
      top:310px;
      height:1px;
      background:rgba(0,0,0,0.26);
      width:200px;
      box-shadow:0 0 14px 2px #000;
      margin-left:0;
      opacity: 1;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a very newbie question and i will probably get downvoted for it,
Dang-I know this is a subjective question so will probably get booted off/locked, but
Ok, so this question will probably get closed, but hell, its 4:30 in the
This will probably be a bot of a waffly question but ill try my
I'm probably going to get abuse for this question but here goes. Oh but
This might be a duplicate question but as you can see they didn't get
This question will probably end in a facepalm, but I've tried for a while
This will probably seem like a noob question but I have managed to intall
This is confusing me, so this question will probably be confusing. I have a
I don't know much about web development, so probably this question will sound exceptionally

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.