Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. JQuery Animate

JQuery Animate

Scheduled Pinned Locked Moved JavaScript
javascripthtmlcssdatabasecom
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SRJ92
    wrote on last edited by
    #1

    Hey, Any ideas why this won't work? i want the text and image to go back to the original position then repeat the previous animation, so the text goes out to the right then resets, and comes back in from the left, and the same for the image ..

    <
    <html>
    <head>
    <script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script>
    <script type="text/javascript">
    $(document).ready(function(){
    bringIn();
    function bringIn()
    {
    $("#animation_image").animate({top:10},"slow");
    $("#animation_text").animate({left:30},2000);
    window.setTimeout(takeOut, 5000);
    };
    function takeOut()
    {
    $("#animation_image").animate({top:401},"slow").queue(function(){
    $("#animation_text").animate({left:1000},"slow",bringIn);
    //new
    $("#animation_text").css({"left":"-600px"});
    $("#animation_image").css({"top":"-200px"});
    $("#animation_text").html("Why you no working");
    });
    };
    });

    </script>
    </head>

    <body>
    <button>Start Animation</button>

    #animation_box
    {
    position:relative;
    width:800px;
    height:300px;
    margin:0px auto 0px auto;
    background-color:#333333;
    overflow:hidden;
    }
    #animation_text
    {
    position:absolute;
    display:block;
    z-index:2;
    left:-600px;
    top:20px;
    width:300px;
    font-family:Arial, Helvetica, sans-serif;
    font-size:30px;
    line-height:45px;
    color:white;
    }
    #animation_image
    {
    position:relative;
    display:block;
    float:right;
    top:-200px;
    margin-right:10px;
    }
    <body>

    							First 3 hours £36
    						
    
    					
    
    					
    
    								![Car image](img/slides/img8.jpg)
    

    </body>
    </html>

    Thanks for all your help

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups