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. ASP.NET
  4. JavaScript Help??

JavaScript Help??

Scheduled Pinned Locked Moved ASP.NET
questionjavascripttoolsperformancehelp
3 Posts 2 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.
  • I Offline
    I Offline
    Imran Adam
    wrote on last edited by
    #1

    Hi I would like to know "how to stop vertical scrolling text in javascript after one iteration". What i have is the text that scrolls continuously, and i want it to make it stop at the top of the box. How can i acheive this effect?? This is the javascript i have; <script language="JavaScript"> function getObject( obj ) { var strObj if ( document.all ) { strObj = document.all.item( obj ); } else if ( document.getElementById ) { strObj = document.getElementById( obj ); } return strObj; } var theTop = 200; var theHeight = 100; var theWidth = 150; var theLeft = 350; var toClip = 200; function scrollNews( newsDiv, toMove ) { theDiv = getObject( newsDiv.toString() ); if ( theDiv == null ) { return; } if ( document.layers ) { theDiv.clip.top = toMove; theDiv.clip.bottom = toMove + toClip; theDiv.top = theTop - toMove; } else { theDiv = theDiv.style; theDiv.clip = "rect(" + toMove + "px " + (theWidth + theLeft) + "px " + (toMove + toClip) + "px 0px)"; theDiv.top = theTop - toMove + 'px'; } if ( ( theTop + theHeight - toMove ) < ( theTop - theHeight - 20 ) ) { toMove = 0; if ( document.layers ) { theDiv.clip.top = theTop; theDiv.clip.bottom = toClip; theDiv.top = theTop } else { theDiv.clip = "rect(" + toMove + "px " + (theWidth + theLeft) + "px " + (toMove + toClip) + "px 0px)"; theDiv.top = theTop + 'px'; } } toMove = (toMove + 2); //speed of scroll setTimeout("scrollNews('" + newsDiv + "'," + toMove + ")", 100); } </script> Any help is much appreciated

    Cheers :)

    A 1 Reply Last reply
    0
    • I Imran Adam

      Hi I would like to know "how to stop vertical scrolling text in javascript after one iteration". What i have is the text that scrolls continuously, and i want it to make it stop at the top of the box. How can i acheive this effect?? This is the javascript i have; <script language="JavaScript"> function getObject( obj ) { var strObj if ( document.all ) { strObj = document.all.item( obj ); } else if ( document.getElementById ) { strObj = document.getElementById( obj ); } return strObj; } var theTop = 200; var theHeight = 100; var theWidth = 150; var theLeft = 350; var toClip = 200; function scrollNews( newsDiv, toMove ) { theDiv = getObject( newsDiv.toString() ); if ( theDiv == null ) { return; } if ( document.layers ) { theDiv.clip.top = toMove; theDiv.clip.bottom = toMove + toClip; theDiv.top = theTop - toMove; } else { theDiv = theDiv.style; theDiv.clip = "rect(" + toMove + "px " + (theWidth + theLeft) + "px " + (toMove + toClip) + "px 0px)"; theDiv.top = theTop - toMove + 'px'; } if ( ( theTop + theHeight - toMove ) < ( theTop - theHeight - 20 ) ) { toMove = 0; if ( document.layers ) { theDiv.clip.top = theTop; theDiv.clip.bottom = toClip; theDiv.top = theTop } else { theDiv.clip = "rect(" + toMove + "px " + (theWidth + theLeft) + "px " + (toMove + toClip) + "px 0px)"; theDiv.top = theTop + 'px'; } } toMove = (toMove + 2); //speed of scroll setTimeout("scrollNews('" + newsDiv + "'," + toMove + ")", 100); } </script> Any help is much appreciated

      Cheers :)

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      why you are not using Marquee For that Set Direction="UP" and BEHAVIOR="Slide"

      Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"

      I 1 Reply Last reply
      0
      • A Abhijit Jana

        why you are not using Marquee For that Set Direction="UP" and BEHAVIOR="Slide"

        Best Regards ----------------- Abhijit Jana Check Out My Latest Article Java.NET : Integration of Java and .NET[^] "Success is Journey it's not a destination"

        I Offline
        I Offline
        Imran Adam
        wrote on last edited by
        #3

        Hi Yes i did think of that. However, Marquee is only compatible with IE. Other browsers like FireFox cannot interpret the tag. Thanks

        Cheers :)

        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