mobile/Style/js/mobiscroll.list-2.5.1.js
(开头部分) 14KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*jslint eqeq: true, plusplus: true, undef: true, sloppy: true, vars: true, forin: true */
(function ($) {
var ms = $.mobiscroll,
defaults = {
invalid: [],
showInput: true,
inputClass: ''
},
preset = function (inst) {
var s = $.extend({}, defaults, inst.settings),
elm = $(this),
input,
prevent,
id = this.id + '_dummy',
lvl = 0,
ilvl = 0,
timer = {},
wa = s.wheelArray || createWheelArray(elm),
labels = generateLabels(lvl),
currWheelVector = [],
fwv = firstWheelVector(wa),
w = generateWheelsFromVector(fwv, lvl);
/**
* Disables the invalid items on the wheels
* @param {Object} dw - the jQuery mobiscroll object
* @param {Number} nrWheels - the number of the current wheels
* @param {Array} whArray - The wheel array objects containing the wheel tree
* @param {Array} whVector - the wheel vector containing the current keys
*/
function setDisabled(dw, nrWheels, whArray, whVector) {
var i = 0;
while (i < nrWheels) {
var currWh = $('.dwwl' + i, dw),
inv = getInvalidKeys(whVector, i, whArray);
$.each(inv, function (i, v) {
$('.dw-li[data-val="' + v + '"]', currWh).removeClass('dw-v');
});
i++;
}
}
/**
* Returns the invalid keys of one wheel as an array
* @param {Array} whVector - the wheel vector used to search for the wheel in the wheel array
* @param {Number} index - index of the wheel in the wheel vector, that we are interested in
* @param {Array} whArray - the wheel array we are searching in
* @return {Array} - list of invalid keys
*/
function getInvalidKeys(whVector, index, whArray) {
var i = 0,
n,
whObjA = whArray,
invalids = [];
while (i < index) {
var ii = whVector[i];
//whObjA = whObjA[ii].children;
for (n in whObjA) {
if (whObjA[n].key == ii) {
后面还有 334 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。