SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist runeveryday's Avatar
    Join Date
    Jul 2009
    Posts
    436
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Scroll the content at the set intervals(500 ms)?

    There are two lines as the following:

    Code:
    <div id="test"> test one jquery is a good library.<br/>
    test two php is a good language.</div>
    now i want to scroll them one by one (the top line hide the bottom line show.vice versa)and the line shows and hides automatically which time interval is 500 milliseconds . the scroll direction is from bottom to top.

    i don't know how to do.

    the following is my code. but I am totally stucked. i don't know how to write the function.

    Code:
    $(function(){
                $('#test').slideUp('500' function(){
            //how to write
          });
            })​

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    Something like a vertical news scroller which you can see in action at this demo page?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Evangelist runeveryday's Avatar
    Join Date
    Jul 2009
    Posts
    436
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    Something like a vertical news scroller which you can see in action at this demo page?
    thank you, if i want to write the code to do myself, how to write the function?

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by runeveryday View Post
    thank you, if i want to write the code to do myself, how to write the function?
    You can look at the plugin code to see how such a thing is written. You'll find though that there are many different details to consider and resolve.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •