JumboTCMS_src/JumboTCMS.WebFile/_libs/jquery.ui-select/jquery.ui-select.js

(开头部分) 7KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
 * jQuery Select Plugins v1.3.5
 * Copyright (c) 2009 zhangjingwei
 * Dual licensed under the MIT and GPL licenses.
 * Date: 2009-08-29 21:10
 * Revision: 1.3.5
 */

(function($){
$.fn.extend({
	sSelect: function() {
		var selectId = $(this).attr('id'),selectZindex = $(this).css('z-index'),selectIndex = $('#'+selectId+' option').index($('#'+selectId+' option:selected')[0]);
		$('#'+selectId).append('<div class="select-dropselectbox"><h4></h4><ul style="display:none"><li></li></ul></div>');
		$('#'+selectId+' h4').empty().append($('#'+selectId+' option:selected').text());
		$('.select-dropselectbox').show();
		var selectWidth;
		$.browser.msie?selectWidth=$('#'+selectId+' select').width():selectWidth = $('#'+selectId).width();
		$('#'+selectId+' h4').css({width:selectWidth});
		var selectUlwidth = selectWidth + parseInt($('#'+selectId+' h4').css("padding-left")) + parseInt($('#'+selectId+' h4').css("padding-right"));
		$('#'+selectId+' ul').css({width:selectUlwidth+'px'});
		$('#'+selectId+' select').hide();
		$('#'+selectId+' div').hover(function(){
			$('#'+selectId+' h4').addClass("over");
		},function(){
			$('#'+selectId+' h4').removeClass("over");
		});
		$('#'+selectId)
		.bind("focus",function(){
			$.fn.clearSelectMenu();
			$('#'+selectId+' h4').addClass("over");
		})
		.bind("click",function(e){
			if($('#'+selectId+' ul').css("display") == 'block'){
				$.fn.clearSelectMenu();
				return false;
			}else{
				if ($.browser.opera){this.clearSelectMenu();}
				$('#'+selectId+' h4').addClass("current");
				$('#'+selectId+' ul').show();
				var selectZindex = $(this).css('z-index');
				if ($.browser.msie || $.browser.opera){$('.select-dropdown').css({'position':'relative','z-index':'0'});}
				$('#'+selectId).css({'position':'relative','z-index':'999'});
				$.fn.setSelectValue(selectId);
				var windowspace = ($(window).scrollTop() + document.documentElement.clientHeight) - $(this).offset().top;
				var ulspace = $('#'+selectId+' ul').outerHeight(true);
				var windowspace2 = $(this).offset().top - $(window).scrollTop() - ulspace;
				windowspace < ulspace && windowspace2 > 0?$('#'+selectId+' ul').css({top:-ulspace}):$('#'+selectId+' ul').css({top:$('#'+selectId+' h4').outerHeight(true)});
				selectIndex = $('#'+selectId+' li').index($('.selectedli')[0]);
				$(window).scroll(function(){
					var windowspace = ($(window).scrollTop() + document.documentElement.clientHeight) - $('#'+selectId).offset().top;
					windowspace < ulspace?$('#'+selectId+' ul').css({top:-ulspace}):$('#'+selectId+' ul').css({top:$('#'+selectId+' h4').outerHeight(true)});
				});
				$('#'+selectId+' li').click(function(e){										  
						selectIndex = $('#'+selectId+' li').index(this);
						$('#'+selectId+' select')[0].selectedIndex = selectIndex;
						$('#'+selectId+' h4').empty().append($('#'+selectId+' option:selected').text());
						$.fn.clearSelectMenu(selectId,selectZindex);
						e.stopPropagation();
						e.cancelbubble = true;
				})
后面还有 159 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。