-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery-ui-slider-pips-min.js
executable file
·5 lines (4 loc) · 2.21 KB
/
jquery-ui-slider-pips-min.js
1
2
3
4
5
/* jquery slider pips plugin, version 1.1 */
;(function(e){var t={pips:function(t){options={first:"label",last:"label",rest:"pip",labels:false,prefix:"",suffix:""};e.extend(options,t);this.options.labels=options.labels;this.element.addClass("ui-slider-pips").find(".ui-slider-pip").remove();var n=this.options.max-this.options.min;for(i=0;i<=n;i++){var r=this.options.labels?this.options.labels[i]:this.options.min+i;if(typeof r==="undefined"){r=""}var s=e('<span class="ui-slider-pip ui-slider-pip-'+i+'"><span class="ui-slider-line"></span><span class="ui-slider-label">'+options.prefix+r+options.suffix+"</span></span>");if(0==i){s.addClass("ui-slider-pip-first");if("label"==options.first){s.addClass("ui-slider-pip-label")}if(false==options.first){s.addClass("ui-slider-pip-hide")}}else if(n==i){s.addClass("ui-slider-pip-last");if("label"==options.last){s.addClass("ui-slider-pip-label")}if(false==options.last){s.addClass("ui-slider-pip-hide")}}else{if("label"==options.rest){s.addClass("ui-slider-pip-label")}if(false==options.rest){s.addClass("ui-slider-pip-hide")}}if(this.options.orientation=="horizontal")s.css({left:""+100/n*i+"%"});else s.css({top:""+100/n*i+"%"});this.element.append(s)}}};e.extend(true,e["ui"]["slider"].prototype,t)})(jQuery);
/* jquery slider float plugin, version 0.6 */
;(function(e){var t={"float":function(t){options={handle:true,labels:true,prefix:"",suffix:""};e.extend(options,t);this.element.addClass("ui-slider-float");if(options.handle){if(this.options.values){var n=[e('<span class="ui-slider-tip">'+options.prefix+this.options.values[0]+options.suffix+"</span>"),e('<span class="ui-slider-tip">'+options.prefix+this.options.values[1]+options.suffix+"</span>")]}else{var n=e('<span class="ui-slider-tip">'+options.prefix+this.options.value+options.suffix+"</span>")}this.element.find(".ui-slider-handle").each(function(t,r){e(r).append(n[t])})}if(options.labels){this.element.find(".ui-slider-label").each(function(t,n){var r=e(n).clone().removeClass("ui-slider-label").addClass("ui-slider-tip-label");r.insertAfter(e(n))})}this.element.on("slidechange slide",function(t,n){e(n.handle).find(".ui-slider-tip").text(options.prefix+n.value+options.suffix)})}};e.extend(true,e["ui"]["slider"].prototype,t)})(jQuery);