Making text bounce in Javascript

Discussion in 'JavaScript' started by blueparukia, Aug 3, 2007.

  1. #1
    How would I go about doing it? I've seen it somewhere before. The text bounces up and down, up and down etc. etc.


    Thanks,

    BP
     
    blueparukia, Aug 3, 2007 IP
  2. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #2
    Nevermind, I can do this in HTML
     
    blueparukia, Aug 3, 2007 IP
  3. nhl4000

    nhl4000 Well-Known Member

    Messages:
    479
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #3
    This was one of the first thing I learned in HTML.
    For those that don't know how. Its the <marquee> tag. Google it for its properties.
     
    nhl4000, Aug 4, 2007 IP
  4. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #4
    Yeah, I always knew how to do it, I just never thought that something like that could be done in HTML - I just wasn't paying attention lol.

    Anyway:

    <marquee direction="up" behaviour="alternate">$1</marquee>
    Code (markup):
     
    blueparukia, Aug 4, 2007 IP
  5. RoyalSeo

    RoyalSeo Peon

    Messages:
    560
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    0
    #5

    Didn't knew about the direction tag, must have forgotten :p

    Thanks
     
    RoyalSeo, Aug 4, 2007 IP
  6. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #6
    No problem...
     
    blueparukia, Aug 4, 2007 IP
  7. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #7
    Don't use <marquee>, use JavaScript, you can get smoother movement, more control over speed and behaviour, more browser compatibility etc. Search "javascript scrollers" or find examples at http://dynamicdrive.com
     
    krt, Aug 4, 2007 IP
  8. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #8
    Well, I prefer HTML, as it is more supported than Javascript - which can be disabled.

    Thanks anyway,

    BP
     
    blueparukia, Aug 4, 2007 IP
  9. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #9
    Those with JS disabled should be used to boring web sites with nothing happening :p And you can use <marquee> as a fallback.
     
    krt, Aug 7, 2007 IP