1.0.7 • Published 4 years ago

cuberotate v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

install

npm install cuberotate --save

Usage

HTML content
<div class="box_rotate boxContainer">
    <ul>
        <li><img src="imageAddress"/></li>
        <li><img src="imageAddress"/></li>
        <li><img src="imageAddress"/></li>
        <li><img src="imageAddress"/></li>
    </lu>
</div>
javascript
import cubeRotate from 'cuberotate';
var options={direct:"v",autoPlay:true,transitionComplete:imgChagnedHandler}
var cube=new cubeRotate(".boxContainer",options);
function imgChangeHandler(imgIndex){
    console.info(“index=",imgIndex);
}
cube.next();
OPTIONS
keydefaultValue
cubeNum4image cube number
autoPlayfalseAuto play or not
playTime4000Auto play time interval
directhimage cube rotate direct that has two value(h or v)
cubeRandomfalseimage cube number Random generation
lowLevefalsenot 3D effect(Compatible with IE browser)
onReadynulla callback function .This function is called after the images are loaded
transitionCompletenulla callback function. This function is called after the image is moved
INTERFACE
1 cube.next();//Switch to the next image
2 cube.prev();//Switch to previous image
3 cube.setIndex(index);//Set index for toggle image
4 cube.setCubeNum(number);//Set the number of rotating blocks
5 cube.setCubeDirect(direct);//direct value is "h" or "v"
6 cube.getIndex();//return value is index
1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago