JavaScript
语言:
JaveScriptBabelCoffeeScript
确定
class WorkList {
/**
*
* @param {object} options
*/
constructor(options) {
const _defaults = {
workItem: '.js-work-item',
workItemPreviewList: '.js-work-preview-list',
workItemImg: '.js-work-preview',
//
activeItemClass: 'is-active',
//
workCanvas: '.js-work-preview-canvas',
};
this.defaults = Object.assign({}, _defaults, options);
if (this.getWorkItem().length > 0) {
this.init();
this.workItemHover(this.getWorkItem());
this.workHover(this.getWorkItemPreviewList());
this.initWorkCanvas();
}
}
// region Getters
/**
*
* @returns {*|jQuery|HTMLElement}
*/
getWorkItem() {
return $(this.defaults.workItem);
}
getWorkItemImg() {
return $(this.defaults.workItemImg);
}
getWorkItemPreviewList() {
return $(this.defaults.workItemPreviewList);
}
getWorkCanvas() {
return $(this.defaults.workCanvas);
}
getCanvasEl() {