Ignore:
Timestamp:
2015-02-09T09:51:09+13:00 (9 years ago)
Author:
bmt11
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/nz-flag-design/trunk/render-3d/Flag_files/slider.js

    r29694 r29719  
    11jQuery(document).ready(function ($) {
     2   
     3    var initialValue = 100;
     4    var curValue = initialValue;
     5    var tooltip = 'Wind Speed: '+curValue+'';
     6   
    27    $("#speed").slider({
    38        min: 25,
    49        max: 300,
    5         value: 100,
     10        value: initialValue,
    611        animate: true,
    712        range: 'min',
     13        create: function(event, ui) {
     14            initTooltip(ui);
     15        },
    816        slide: function(event, ui) {
    9             setSpeed(ui.value);
     17            setSpeed(ui);
    1018        }
    1119    });
     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    }
    1234   
    1335    $(".ui-slider").mouseenter(function(){
     
    1840        controls.enabled = true;
    1941    });
    20    
    21     function setSpeed(speed){
    22         windStrength = speed;
    23     }
     42
    2443});
Note: See TracChangeset for help on using the changeset viewer.