Iscroll Chinese Documents

Source: Internet
Author: User

Transferred from: http://blog.csdn.net/sweetsuzyhyf/article/details/44195549

Iscroll.js Latest Version v5.1.2

Fixed an issue where the input box could not scroll up or down when it was unable to enter and scroll horizontally.

var myscroll = new Iscroll (' #wrapper ', {    disablemouse:true,    disablepointer:true});

Official website: http://iscrolljs.com

github:https://github.com/cubiq/iscroll/

Call-time parameter settings:

Belongs Property name Description Default value
Core Library Croe Options.usetransform Whether to use CSS3 's Transform property True
Options.usetransition Whether to use CSS3 's transition property, otherwise use Requestanimationfram instead True
Options. Hwcompositing Whether to enable hardware acceleration True
Options.bounce Whether to enable the elastic animation effect, turn off to accelerate True
Basic features Basic Features Options.Click Whether the Click event is enabled. It is recommended to turn this option off and enable the custom tap event (OPTIONS.TAP) False
Options.disablemouse Whether to turn off mouse event detection. If you know which platform to run on, you can turn it on to speed up. False
Options.disablepointer Whether to turn off pointer event probing. If you know which platform to run on, you can turn it on to speed up. False
Options.disabletouch Whether to turn off touch event probing. If you know which platform to run on, you can turn it on to speed up. False
Options.eventpassthrough If you want to use the system vertical axis to scroll and take effect on the horizontal axis when using the Iscroll horizontal scroll, turn it on. Event Passthrough Demo False
Options.freescroll Mainly in the upper and lower left and right scrolling are in effect when used, you can scroll in any direction. Scroll Demo False
Options.keybindings Binds a key event. Key Bindings False
Options.invertwheeldirection Reverse mouse wheel. False
Options.momentum Whether to turn on momentum animation, off can improve efficiency. True
Options.mousewheel Whether to listen for mouse wheel events. False
Options.preventdefault Whether to mask default events. True
Options.scrollbars Whether to display the default scroll bar False
Options.scrollXoptions.scrollY You can set the initial position of the Iscroll scroll 0
Options.tap Whether to enable custom tap events to customize the Tap event name False
scroll bar scrollbars Options.scrollbars Whether to display the default scroll bar False
Options.fadescrollbars If the scrollbar is faded, turn it off to accelerate True
Options.interactivescrollbars Whether the user can drag the scroll bar False
Options.resizescrollbars If the scrollbar size is fixed, it is recommended that you turn it on when customizing the scroll bar. False
Options.shrinkscrollbars Whether the scroll bar is shrunk when scrolling exceeds the scrolling boundary. ' clip ': trim out of the scroll bar

' Scale ': Proportional shrink scrollbar (consumes CPU resources)

False: Do not shrink,

False
Options.indicators Indicates how the Iscroll should scroll, scrollbars the underlying implementation.
Options.indicators.el The container in which the scroll bar is drawn. The first element in the container is an indicator. For example:

Indicators: {

El:document.getElementById (' indicator ')

}

Indicators: {

El: ' #indicator '

}

Options.indicators.ignoreBoundaries Whether to ignore container boundaries. True to set the scrolling speed Parallax Demo False
Options.indicators.listenXoptions.indicators.listenY The indicator listens for scrolling in that direction, can be set to One direction or 2 directions True
Options.indicators.speedRatioXoptions.indicators.speedRatioY The speed of the indicator relative to the main scroll bar 0
Options.indicators.fadeoptions.indicators.interactive

Options.indicators.resize

Options.indicators.shrink

Settings such as scrollbars Minimap demo
Options.probetype Need to use Iscroll-probe.js to take effect probetype:1 when scrolling is not busy

Probetype:2 is triggered every time during scrolling

Probetype:3 trigger once per pixel scrolling

Split page Snap Options.snap Auto-split container for making merry effects and so on. options.snap:true//Automatic segmentation according to container size

options.snap:el//Based on element segmentation

False
Zooming zoom Options.zoom Whether to turn on scaling best Use Iscroll-zoom.js

If you zoom in to blur, you can define the source container to be twice times the size, then scale (0.5)

Zoom Demo

False
Options.zoommax Maximum zoom level 4
Options.zoommin Minimum zoom level 1
Options.zoomstart Initial zoom level 1
Options.wheelaction The wheel action is set to ' zoom ' and can be scaled with the wheel Undefined
More Settings Options.bindtowrapper Whether to stop scrolling when the cursor or touch exceeds the container False
Options.bounceeasing Stretch animation effect presets: ' quadratic ', ' circular ', ' back ', ' bounce ', ' elastic ' (last two cannot be performed by CSS3)

You can also customize the effect

Bounceeasing: {

Style: ' Cubic-bezier (0,0,1,1) ',//CSS3

Fn:function (k) {return k;} Do not use CSS3, when using Requestanimationframe

}

' Circular '
Options.bouncetime The number of milliseconds the stretch animation lasts 600
Options.deceleration The larger the rolling momentum deceleration, the faster it is recommended that no more than 0.01 0.0006
Options.mousewheelspeed Mouse wheel speed
Options.preventdefaultexception Lists which elements do not mask default events; {tagName:/^ (input| textarea| button| SELECT) $/}
Options.resizepolling Recalculate the Iscroll time interval when resizing the window 60
Keyed bindings Options.keybindings Monitor key event Control Iscroll for example:

KeyBindings: {

Pageup:33,

Pagedown:34,

End:35,

HOME:36,

Left:37,

Up:38,

Right:39,

Down:40

}

Api:
Belongs Method name Description
Rolling ScrollTo (x, Y, time, easing) Scroll to: x, Y, event, easing mode X:int

Y:int

Time:int

easing:quadratic | Circular | Back | Bounce | Elastic

See IScroll.utils.ease objects

Cases:

Myscroll.scrollto (0, -100, IScroll.utils.ease.elastic);

Scrollby (x, Y, time, easing) Scroll to a point relative to the current position.
Scrolltoelement (EL, Time, OffsetX, OffsetY, easing) Scrolls to an element. El is the required parameter offsetx/offsety: Displacement relative to the El element. Set to true for screen center

Scroll to Element

Split page Snap GoToPage (x, Y, time, easing) According to the Options.snap split page, jump to the landscape, portrait of a page. XY can take effect at the same time. Combined with Options.snap
Next () prev () Previous page, next page combined with Options.snap
Scaling Zoom (scale, x, Y, time) Scaling container scale: scaling factor
Refresh Refresh () Refresh Iscroll
Destroyed Destroy () Destroy Iscroll, save resources
Event Usage:
Beforescrollstart The user taps the screen, but has not initialized before scrolling
Scrollcancel Initialize and cancel after scrolling
Scrollstart Start scrolling
Scroll Scrolling in
Scrollend Scroll End
Flick Tap the left and right of the screen
Zoomstart Start scaling
Zoomend Zoom End
Properties of the Iscroll:

Iscroll Chinese Documents

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.