source: other-projects/nz-flag-design/trunk/render-3d/Flag_files/slider.js@ 29719

Last change on this file since 29719 was 29719, checked in by bmt11, 9 years ago

Added Tooltip for slider need to rework so that it doesnt overlay

File size: 901 bytes
Line 
1jQuery(document).ready(function ($) {
2
3 var initialValue = 100;
4 var curValue = initialValue;
5 var tooltip = 'Wind Speed: '+curValue+'';
6
7 $("#speed").slider({
8 min: 25,
9 max: 300,
10 value: initialValue,
11 animate: true,
12 range: 'min',
13 create: function(event, ui) {
14 initTooltip(ui);
15 },
16 slide: function(event, ui) {
17 setSpeed(ui);
18 }
19 });
20
21 function initTooltip(ui){
22 tooltip = 'Wind Speed: '+curValue+'';
23 var target = ui.handle || $('.ui-slider-handle');
24 $(target).html(tooltip);
25 }
26
27 function setSpeed(ui){
28 windStrength = ui.value;
29 curValue = ui.value;
30 tooltip = 'Wind Speed: '+curValue+'';
31 target = ui.handle || $('.ui-slider-handle');
32 $(target).html(tooltip);
33 }
34
35 $(".ui-slider").mouseenter(function(){
36 controls.enabled = false;
37 });
38
39 $(".ui-slider").mouseleave(function(){
40 controls.enabled = true;
41 });
42
43});
Note: See TracBrowser for help on using the repository browser.