WebContent/jquery-easyui-1.3.3/src/jquery.combobox.js
(开头部分) 12KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/**
* combobox - jQuery EasyUI
*
* Copyright (c) 2009-2013 www.jeasyui.com. All rights reserved.
*
* Licensed under the GPL or commercial licenses
* To use it on other terms please contact us: info@jeasyui.com
* http://www.gnu.org/licenses/gpl.txt
* http://www.jeasyui.com/license_commercial.php
*
* Dependencies:
* combo
*
*/
(function($){
function findDataItem(data,key,value){
for(var i=0; i<data.length; i++){
var item = data[i];
if (item[key] == value){return item}
}
return null;
}
/**
* scroll panel to display the specified item
*/
function scrollTo(target, value){
var panel = $(target).combo('panel');
var item = panel.find('div.combobox-item[value="' + value + '"]');
if (item.length){
if (item.position().top <= 0){
var h = panel.scrollTop() + item.position().top;
panel.scrollTop(h);
} else if (item.position().top + item.outerHeight() > panel.height()){
var h = panel.scrollTop() + item.position().top + item.outerHeight() - panel.height();
panel.scrollTop(h);
}
}
}
function nav(target, dir){
var opts = $(target).combobox('options');
var panel = $(target).combobox('panel');
var item = panel.children('div.combobox-item-hover');
if (!item.length){
item = panel.children('div.combobox-item-selected');
}
item.removeClass('combobox-item-hover');
if (!item.length){
item = panel.children('div.combobox-item:visible:' + (dir=='next'?'first':'last'));
} else {
if (dir == 'next'){
item = item.nextAll(':visible:first');
if (!item.length){
item = panel.children('div.combobox-item:visible:first');
}
} else {
item = item.prevAll(':visible:first');
if (!item.length){
item = panel.children('div.combobox-item:visible:last');
后面还有 409 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
