JS intermittent scrolling code [added some features]

Source: Internet
Author: User

the last demo was too simple. It is estimated that everyone is not interested in it. This time, I will not play a new window to see the effect. Let's take a look. There seems to be some conflict with the garden style on the page [no problem in Firefox]. Let's take a look. We recommend that you directly go to the demo. Haha demo download. A new demo with a button is added.
fixed the added content:
1. fixed the problem that multiple settimeouts are triggered when a continuous mouseout occurs.
2. Add the first row and Click Previous to jump to the last record.
3. Added scrollamount and scrolldelay attributes to [attributes similar to Marquee].
4. A direction attribute is added, which only enables up and down. If you are interested, you can implement left and right.
5. change the btnprevious and btnnext parameters to optional parameters.
6. Found the functions that can be used as marquee.
latest product name: latest product 1
Description: latest product 1 has arrived.
price: ¥999.99 name: latest product 2
Description: latest product 2 arrived.
price: ¥999.99 name: latest product 3
Description: latest product 3 has arrived.
price: ¥999.99 name: latest product 4
Description: latest product 4 has arrived.
price: $999.99 scroll up
var scrollup = new scrolltext ("listcontent");
scrollup. lineheight = 60;
scrollup. amount = 4;
scrollup. start ();

Latest Product Name: latest product 1
Description: The latest product 1 has arrived.
Price: ¥999.99 name: latest product 2
Description: The latest product 2 has arrived.
Price: ¥999.99 name: latest product 3
Description: The latest product 3 has arrived.
Price: ¥999.99 name: latest product 4
Description: Product 4 has arrived.
Price: ¥999.99 can also be used as marquee
VaR marquee = new scrolltext ("listmarquee ");
Marquee. lineheight = 60;
Marquee. Amount = 1;
Marquee. Timeout = 30;
Marquee. Delay = 30;
Marquee. Start ();

Latest Product Name: latest product 1
Description: The latest product 1 has arrived.
Price: ¥999.99 name: latest product 2
Description: The latest product 2 has arrived.
Price: ¥999.99 name: latest product 3
Description: The latest product 3 has arrived.
Price: ¥999.99 name: latest product 4
Description: Product 4 has arrived.
Price: $999.99 scroll down
VaR scrolldown = new scrolltext ("listcontent ");
Scrolldown. lineheight = 60;
Scrolldown. Amount = 4;
Scrolldown. Direction = "down ";
Scrolldown. Start ();

latest product name: latest product 1
Description: latest product 1 has arrived.
price: ¥999.99 name: latest product 2
Description: latest product 2 arrived.
price: ¥999.99 name: latest product 3
Description: latest product 3 has arrived.
price: ¥999.99 name: latest product 4
Description: latest product 4 has arrived.
price: the effect of adding a button next to ¥999.99
var scrolldown = new scrolltext ("listwithbtn", "scrollpre", "scrollnext");
scrolldown. lineheight = 60;
scrolldown. amount = 4;
scrolldown. start ();

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.