Can control the picture to scroll JS code

Source: Internet
Author: User
Keywords Web page production Ajax javascript
Tags advertising ajax class click code content control download

This article collection of a picture of the scroll code to download the source, is a use of JS to achieve the advertising picture can scroll around the picture advertising code, which is from the Taobao station focus map 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" >
<head>
<meta http-equiv= "Content-type" content= "HTML; charset=gb2312 "/>
<title> can control the picture left and right scroll JS code </title>
<script src= "js/tbhb.js" type=text/Web page special effects ></script>
<link href= "CSS tutorial/css.css" Type=text/css rel=stylesheet>
</head>

<body>

&lt;div class=main-wrap&gt;


&lt;div id=slide-box&gt;


&lt;b class=corner&gt;&lt;/b&gt;


&lt;div class=slide-content id=j_slide&gt;


&lt;div class=wrap&gt;


&lt;ul class=ks-switchable-content&gt;


&lt;li&gt;&lt;a href= "http://www.jzread.com/" target=_blank&gt;&lt;img alt= "jzread.com" src= "images/01.jpg" &gt; &lt;/a&gt;&lt;/li&gt;


&lt;li&gt;&lt;a href= "http://www.jzread.com/" target=_blank&gt;&lt;img alt= "jzread.com" src= "Images/02.jpg" &gt;&lt;/a&gt;&lt;/li&gt;


&lt;li&gt;&lt;a href= "http://www.jzread.com/" target=_blank&gt;&lt;img alt= "jzread.com" src= "Images/03.jpg" &gt;&lt;/a&gt;&lt;/li&gt;


&lt;li&gt;&lt;a href= "http://www.jzread.com/" target=_blank&gt;&lt;img alt= "jzread.com" src= "Images/04.jpg" &gt;&lt;/a&gt;&lt;/li&gt;


&lt;li&gt;&lt;a href= "http://www.jzread.com/" target=_blank&gt;&lt;img alt= "jzread.com" src= "Images/05.jpg" &gt;&lt;/a&gt;&lt;/li&gt;


&lt;li&gt;&lt;a href= "http://www.jzread.com/" target=_blank&gt;&lt;img alt= "jzread.com" src= "images/06.jpg" &gt; &lt;/a&gt;&lt;/li&gt;


&lt;/ul&gt;


&lt;/div&gt;


&lt;div class=ks-switchable-triggers&gt;


&lt;a class=prev id=j_prev href= "javascript:void (0);" &gt;


&lt;b class=corner&gt;&lt;/b&gt;&lt;span&gt;&amp; #8249; &lt;/span&gt;&lt;b class=corner&gt;&lt;/b&gt;&lt;/a &gt;


&lt;a class=next id=j_next href= "javascript:void (0);" &gt;


&lt;b class=corner&gt;&lt;/b&gt;&lt;span&gt;&amp; #8250; &lt;/span&gt;&lt;b class=corner&gt;&lt;/b&gt;&lt;/a &gt; &lt;/div&gt;


&lt;/div&gt;


&lt;b class=corner&gt;&lt;/b&gt; &lt;/div&gt;


&lt;/div&gt;

<script type=text/javascript>
var d=yahoo.util.dom, E=yahoo.util.event;

Kissy (). Use ("*", function (s) {
var el = d.get (' j_slide '),
Activeindex = parseint (El.getattribute (' Data-active-index ')) | | 0;

var carousel = new S.carousel (EL, {
Hastriggers:false,
Navcls: ' Ks-switchable-nav ',
Contentcls: ' Ks-switchable-content ',
Activetriggercls: ' Current ',
Multiplying: "Scrollx",
Tournaments Tutorial: 2,
Viewsize: [680],
Activeindex:activeindex
});

E.ON (' J_prev ', ' click ', Carousel.prev, Carousel, True);
E.ON (' J_next ', ' click ', Carousel.next, Carousel, True);
});

Kissy (). Use ("*", function (s) {
var el = d.get (' j_shoppingguide ');
if (!el) {
Return;
}
var activeindex = parseint (El.getattribute (' Data-active-index ')) | | 0;

var carousel = new S.carousel (EL, {
Navcls: ' Ks-switchable-nav ',
Contentcls: ' Ks-switchable-content ',
Activetriggercls: ' Current ',
Multiplying: "Scrollx",
Steps:4,
Viewsize: [720],
Activeindex:activeindex
});

E.ON (' J_shoppingguideprev ', ' click ', Carousel.prev, Carousel, True);
E.ON (' J_shoppingguidenext ', ' click ', Carousel.next, Carousel, True);
});
</script>

</div>
</body>
</html>

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.