- Timestamp:
- 2015-02-09T12:11:28+13:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nz-flag-design/trunk/render-3d/Flag_files/slider.js
r29719 r29721 2 2 3 3 var initialValue = 100; 4 var curValue = initialValue;5 var t ooltip = 'Wind Speed: '+curValue+'';4 var tooltip = '<span class="tt"><span class="text">'+getDescript(initialValue)+'</span></span>'; 5 var target; 6 6 7 7 $("#speed").slider({ … … 20 20 21 21 function initTooltip(ui){ 22 tooltip = 'Wind Speed: '+curValue+''; 23 var target = ui.handle || $('.ui-slider-handle'); 24 $(target).html(tooltip); 22 target = ui.handle || $('.ui-slider-handle'); 25 23 } 26 24 27 25 function setSpeed(ui){ 28 26 windStrength = ui.value; 29 curValue = ui.value; 30 tooltip = 'Wind Speed: '+curValue+''; 31 target = ui.handle || $('.ui-slider-handle'); 32 $(target).html(tooltip); 27 tooltip = '<span class="tt"><span class="text">'+getDescript(ui.value)+'</span></span>'; 28 target = ui.handle || $('.ui-slider-handle'); 29 $(target).html(tooltip); 30 } 31 32 function getDescript(speed){ 33 if(speed < 50) return 'calm'; 34 if(speed < 100) return 'light'; 35 if(speed < 150) return 'fair'; 36 if(speed < 200) return 'heavy'; 37 return 'gusty'; 33 38 } 34 39 35 40 $(".ui-slider").mouseenter(function(){ 36 41 controls.enabled = false; 42 $(target).html(tooltip); 37 43 }); 38 44 39 45 $(".ui-slider").mouseleave(function(){ 40 46 controls.enabled = true; 47 $(".tt").remove(); 41 48 }); 42 49
Note:
See TracChangeset
for help on using the changeset viewer.