Results 1 to 4 of 4

Thread: horizontal marquee rtl

  1. #1
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default horizontal marquee rtl

    Cross Browser marquee

    http://www.dynamicdrive.com/dynamicindex2/cmarquee.htm

    How can I seperate the script and the html content?
    I want to add the JS to a specific html div,
    How can I make it?

    Thanks!

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I don't know the answer to this question (at least not yet), but I do know that you need to give more information. What do you mean "separate"? If you completely separate them, then it won't work any more. Can you give an example?
    And a link to the page would probably help.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default

    I mean to have div that will work with this function

    like the html will include:

    <div id="animation">content</div>

    and the script will include document.getElementById('animation')


    Thanks

  4. #4
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    </head>
    
    <body>
     <div style="position:relative;overflow:hidden;width:300px;height:30px;background-color:#99CCFF" onmouseover="M1.Speed=0;" onmouseout="M1.Speed=2;" >
      <div id="marquee1" style="position:absolute;left:0px;top:0px;white-Space:nowrap;"><font face="Arial">Thank you for visiting <a href="http://www.dynamicdrive.com">Dynamic Drive.</a> If you find this script useful, please consider linking to us by <a href="../link.htm">click here.</a> Enjoy your stay!</font></div>
     </div>
    
     <div style="position:relative;overflow:hidden;width:300px;height:30px;background-color:#99CCFF" onmouseover="M2.Speed=0;" onmouseout="M2.Speed=1;" >
      <div id="marquee2" style="position:absolute;left:0px;top:0px;white-Space:nowrap;"><font face="Arial">Thank you for visiting <a href="http://www.vicsjavascripts.org.uk/">Vics Javascripts.</a> If you find this script useful, please consider linking to us by <a href="../link.htm">click here.</a> Enjoy your stay!</font></div>
     </div>
    <script type="text/javascript">
    /*<![CDATA[*/
    
    function Marquee(o){
     this.obj=document.getElementById(o.ID);
     this.mm=[-this.obj.offsetWidth,this.obj.parentNode.offsetWidth];
     this.obj.style.left=this.mm[1]+'px';
     this.Speed=o.Speed||1;
     this.Rotate();
    
    }
    
    Marquee.prototype.Rotate=function(){
     var oop=this,lft=parseInt(this.obj.style.left)-this.Speed;
     this.obj.style.left=lft+'px';
     if (lft<this.mm[0]){
      this.obj.style.left=this.mm[1]+'px';
     }
     this.to=setTimeout(function(){ oop.Rotate(); },20);
    }
    
    var M1=new Marquee({
     ID:'marquee2',
     Speed:2
    });
    
    var M2=new Marquee({
     ID:'marquee1'
    });
    
    /*]]>*/
    </script>
    </body>
    
    </html>
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  5. The Following User Says Thank You to vwphillips For This Useful Post:

    d-machine (07-03-2010)

Bookmarks

Posting Permissions

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