Several ways of the focus map of the Pacific Women's Network

Source: Internet
Author: User
Tags prev
1, have the control button and write their own control Div
<script language= "JavaScript" >
var TOCs = Pc.getelems (' #focuspic li ');
Window.focuspic = new Pc.tab ({
Target:tocs,
Control:false,
Type: ' Click ',
stay:10000,
Autoplay:true,
Effect: ' fade ',
Playto:tocs.length-1
});
Focuspic.next ();
</script>

Actually, there are several parameters.
Effect: ' fade ',
Onchange:function () {
var to = This.curpage && this.curpage-1; Keep elements clickable before current tab
Tab0102.playto (to);
}
2, if the focus chart also with left and right arrow
<<span class= "Start-tag" >a href= "Javascript:focusPic.prev () "Onmouseover="focuspic.stop () "onmouseout="Focuspic.play () "target="_self "class="prev "id="Jprev "><<span class=" Start-tag ">span></<span class=" End-tag ">span><<span class= "Start-tag" >i></<span class= "End-tag" >i></<span class= "End-tag" >a>
<<span class= "Start-tag" >a href= "
Javascript:focusPic.next () "Onmouseover="focuspic.stop () "onmouseout="Focuspic.play () "target="_self "class="Next "id="Jnext "><<span class=" Start-tag ">span></<span class=" End-tag ">span><<span class=" Start-tag ">i></<span class=" End-tag ">i></<span class=" End-tag ">a>
Focuspic.next ();
Below this function you can see is looking for I, let I sliding a certain distance, in fact, the practicality is not strong, mainly is the demonstration under the PC frame animation use method.
var _prev = Pc.getelem (' #JPrev '), _next = Pc.getelem (' #JNext '); Pc.addevent (_prev, ' MouseEnter ', function () {Animatehover (this,1,50)}) pc.addevent (_prev, ' MouseLeave ', function () { Animatehover (this,1,20)}) pc.addevent (_next, ' MouseEnter ', function () {animatehover (this,2,50);}) Pc.addevent (_next , ' MouseLeave ', function () {Animatehover (this,2,20)})
function Animatehover (obj,direct,m) {var _i = pc.getelems (' i ', obj) [0]; Pc.end (_i); if (direct = = 1) {pc.animate (_i,{right : M}, ' Swing ', 250); }else{pc.animate (_i,{left:m}, ' Swing ', 250);}}

The switching effect of the PC opens several functions manslide.play (), a manslide.stop (), a javascript:manSlide.next (), a javascript:manSlide.prev (), Can be called directly as a controller, but one of the conditions is that we have to assign the new pc.tab.scroll to the window.manslide variable, instead of just using the new pc.tab.scroll so we can't use stop.
3, the PC's page card switch is also very simple
Use the Pc.tab, while the PC's focus graph uses the Pc.tab.scroll method to pay attention to the difference
New Pc.tab ({
Target:pc.getElems (' #links_con. Contentdiv '),
Control:pc.getElems (' #lumpTab. Control. ToC ')
});
In fact, Pc.tab also has some common parameters
Target:pc.getElems (' #focusPic. Slide Li ')
Control:pc.getElems (' #focusPic. Control li ')
Effect: ' base '
Autoplay:true
stay:3500
Lazy:true
See no, this page card switch also can realize the automatic play. And the efficiency of the PC frame can also
4, about the OnChange method
pc OnChange method open for the user to customize the effect of the switch, the following is implemented to the page card plus cur, instead of the current class
 onchange:function () {var
c = this.curpage; 
Pc.each (Tabthumbs, function (Ele, inx) {if (inx = = c) {pc.addclass (ele, ' cur ');} else {pc.removeclass (ele, ' cur ');}}); 

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.