views:

67

answers:

2

Hi

I want to implement animated text i.e. moving the text from bottom (half of the page) to the top like marquee. I don't get any good code. Does any one know how this is implemented in JavaScript or jQuery or DHTML?

Thanks in advance

+4  A: 

use jquery

  $('#mydiv').animate({
    top: 0
  }, 5000, function() {
    // Animation complete.
  });

Check the demo here

Starx
thanks. i need the text must be move from bottom to top and again( continuously like marquee up direction). Could you please give me an complete answer
Hema
Tell me Why dont you use the marquee it self, it is much better than writing these scripts.
Starx
A: 

Same code as the answer below but, it sets the TEXT location to be at half the page's height, and then animates it to top:

//Calculate where is HALF of the page (half the window height)
var start_pos = screen.height/2;

//Set starting TOP location
$(".text").css("top", start_pos+"px");    

//Animate to the END location, which is 0px
$(".text").animate({ top:0+"px" }, 5000, function() { alert("Animation Complete"); });

​
Cipi