JQuery implements intermittent upward scrolling source code for a single line of text

Source: Internet
Author: User

Use jQuery to intermittently scroll up a single line of text

Effect Web site: http://www.keleyi.com/keleyi/phtml/textscroll.htm
This effect enhanced version: http://www.keleyi.com/a/bjac/532bedbffca1affa.htm mainly increased the cursor hover Effect

The source code is as follows:
Copy codeThe Code is as follows:
<Script type = "text/javascript" src = "http://www.keleyi.com/keleyi/pmedia/jquery-1.9.1.min.js"> </script>
<Style type = "text/css">
. ScrollDiv {height: 25px;/* required element */line-height: 25px; border: # ccc 1px solid; overflow: hidden;/* required element */}
. ScrollDiv li {height: 25px; padding-left: 10px ;}
Ul, li {list-style-type: none; margin: 0px ;}</style>

<H2> jquery special effect single-line text Scrolling up (intermittent) <Div id = "scrollDiv_keleyi_com" class = "scrollDiv">
<Ul>
<Li> <a href = "http://www.keleyi.com/a/bjac/5d7f4ac2efa72d30.htm"> the menu is fixed after scrolling to the top </a> </li>
<Li> <a href = "http://www.keleyi.com/a/bjac/141932b419e08101.htm"> jquery uses ColorBox to pop up the picture group browsing layer </a> </li>
<Li> <a href = "http://www.keleyi.com/dev/fd9291320daf9360.htm"> sliding up the lower right corner of jquery to close the reproduction layer </a> </li>
<Li> <a href = "http://www.keleyi.com/a/bjac/bf0eb8c02085b10d.htm"> jquery clears input boxes such as textarea </a> </li>
</Ul>
</Div>
<Script type = "text/javascript">
Function AutoScroll (obj ){
$ (Obj). find ("ul: first"). animate ({
MarginTop: "-25px"
},500, function (){
Vertex (this).css ({marginTop: "0px"}). find ("li: first"). appendTo (this );
});
}
$ (Document). ready (function (){
SetInterval ('autoscroll ("# scrollDiv_keleyi_com") ', 3000 );
});
</Script>

Resolution:Use $ ('lil') to match a set of multiple li elements.
If you want to obtain the first li element, you can use ": first", that is, $ ('li: first ');

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.