Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default Alternative to <marquee>?

    Are there any alternatives to <marquee>? I don't want to use it since it's deprecated. Is there some way to do this in javascript, etc.?
    Vouches
    [x][x]

  2. #2
    Join Date
    Feb 2009
    Location
    Leeds
    Posts
    4,896
    Tokens
    2,337

    Latest Awards:

    Default

    <script type="text/javascript">
    function beginrefresh(){
    var marquee=document.getElementById("marquee_text");//set the id of the target object
    if(marquee.scrollLeft>=marquee.scrollWidth-parseInt(marquee.style.width))marquee.scrollLeft=0 ;
    marquee.scrollLeft+=1;
    setTimeout("beginrefresh()",10);//set the delay (ms), bigger delay, slower movement
    }
    </script>

    from google dunno if that helps

  3. #3
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    I found this: http://remysharp.com/2008/09/10/the-...mooth-marquee/

    I'm not good with JS so I don't really know how to implement it.

    In the the <head>, I put

    HTML Code:
     <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="marquee.js"></script>
    <script type="text/javascript">
    $(function () {
    $('div.breadcrumb marquee').marquee('pointer').mouseover(function () {
    $(this).trigger('stop');
    }).mouseout(function () {
    $(this).trigger('start');
    }).mousemove(function (event) {
    if ($(this).data('drag') == true) {
    this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
    }
    }).mousedown(function (event) {
    $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
    }).mouseup(function () {
    $(this).data('drag', false);
    });
    });
    </script>
    And in the <body> where I want my marquee to go I put

    HTML Code:
     <marquee behavior="scroll" direction="left" scrollamount="2" width="100%">
            <b>Latest News:</b> <a href="#">Welcome!</a> (03/01/10) | <b>Today's Birthdays:</b> <a href="#">Dylan</a> (34), <a href="#">John</a> (16), <a href="#">Bob</a> (70)
        </marquee>
    I've never used jquery before so I'm not to sure how to implement it.
    Vouches
    [x][x]

  4. #4
    Join Date
    Oct 2008
    Location
    The Milky Way
    Posts
    728
    Tokens
    0

    Latest Awards:

    Default

    What's wrong with Marquee, you can set it to go left or right, up or down, it's fine?
    Promise this
    If I die before I wake oh
    Promise this
    Take the time to say your grace
    On your knees you'll pray for me
    Promise this
    Be the last to kiss my lips...

  5. #5
    Join Date
    Apr 2010
    Location
    Newcastle
    Posts
    655
    Tokens
    50

    Default

    Quote Originally Posted by Cherpi View Post
    What's wrong with Marquee, you can set it to go left or right, up or down, it's fine?
    I don't want to use it since it's deprecated
    Means it's "looked down upon" my designers and might not be supported in future.

  6. #6
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    It's not xHTML valid plus it's a ***** to click links on a marquee (with JS I can make it stop on mouseover). Also, most browsers don't render it properly (choppy scrolling, etc.)
    Vouches
    [x][x]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •