public/static/common/js/plugin/noUiSlider/jquery.nouislider.js

(开头部分) 2KB

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

/* noUiSlider - refreshless.com/nouislider/ */
(function($, UNDEF){

	$.fn.noUiSlider = function( options ){

		var  namespace = '.nui'
			// Create a shorthand for document event binding
			,all = $(document)
			// Create a map of touch and mouse actions
			,actions = {
				 start: 'mousedown' + namespace + ' touchstart' + namespace
				,move: 'mousemove' + namespace + ' touchmove' + namespace
				,end: 'mouseup' + namespace + ' touchend' + namespace
			}
			// Make a copy of the current val function.
			,$VAL = $.fn.val
			// Define a set of standard HTML classes for
			// the various structures noUiSlider uses.
			,clsList = [
				 'noUi-base'		// 0
				,'noUi-origin'		// 1
				,'noUi-handle'		// 2
				,'noUi-input'		// 3
				,'noUi-active'		// 4
				,'noUi-state-tap'	// 5
				,'noUi-target'		// 6
				,'-lower'			// 7
				,'-upper'			// 8
				,'noUi-connect'		// 9
				,'noUi-vertical'	// 10
				,'noUi-horizontal'	// 11
				,'handles'			// 12
				,'noUi-background'	// 13
				,'noUi-z-index'		// 14
			]
			// Define an extendible object with base classes for the various
			// structure elements in the slider. These can be extended by simply
			// pushing to the array, which reduces '.addClass()' calls.
			,stdCls = {
				 base: [clsList[0], clsList[13]]
				,origin: [clsList[1]]
				,handle: [clsList[2]]
			}
			// The percentage object contains some well tested math to turn values
			// to and from percentages. It can be a bit strange to wrap your head
			// around the individual calls, but they'll do their job with all positive
			// and negative input values.
			,percentage = {
				 to: function ( range, value ) {
					value = range[0] < 0 ? value + Math.abs(range[0]) : value - range[0];
					return (value * 100) / this.len(range);
				}
				,from: function ( range, value ) {
					return (value * 100) / this.len(range);
				}
				,is: function ( range, value ) {
					return ((value * this.len(range)) / 100) + range[0];
				}
				,len: function ( range ) {
					return (range[0] > range[1] ? range[0] - range[1] : range[1] - range[0]);

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

AI 解读 AI

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

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