A small and simple playbar wri
A small and simple playbar written in pure js. Check the example [website] (https://mbalota.github.io/playbar.js/).
HOW TO USE:
script source the minified playbar.js (playbar.min.js) initialize a custom playBar, e.g.:var newPlayBar = new playBar ("#wrapperId", { buttonId: "#bid", //default: "#pb-Button" progressId: "#pid", //default: "#pb-Progress" previewId: "#ppid", //default: "#pb-Progress-Preview" loadedId: "#plid", //default: "#pb-Progress-Loaded" moveButtonToPreview: true, //if 'true', button will move to preview progress enableButtonOffset: true, //to enable out of range button offset, incl. custom offset buttonOffset: {5,0}, //x,y IN PX barType: "horizontal",//can be "vertical" showPreview: true, //enables previewProgress showLoaded: true //enables loadedProgress });
Don't worry, a lot of the options are "optional" badum tsss.
FOR MORE DOCUMENTATION READ THE DEV-COMMENTS IN THE NORMAL playbar.js!
There are 3 functions:
playBar.setProgress(number); //0-100, progressId.style.width/height & buttonId.style.left/bottom will be set to px playBar.setPreviewProgress(number); /* 0-100, the button will update its position, if moveButtonToPreview is set to true , if the preview progress option is enabled and if the preview progress isn't 0 */ playBar.setLoadedProgress(number); // 0-100, it behaves like the normal progress
For more information check out the pretty version! playbar.js
THIS PROJECT USES THE UNLICENSE.
-[Matthias Balota] (http://balota.me/)
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。