scripts/position.js
changeset 42 774751e7faed
parent 11 0faea3a6c881
child 78 08f8a72b1f7b
equal deleted inserted replaced
41:6e0beb10566d 42:774751e7faed
    41 var posslide_handle_dragend = function(x, y)
    41 var posslide_handle_dragend = function(x, y)
    42 {
    42 {
    43   pos_in_drag = false;
    43   pos_in_drag = false;
    44   var inner = document.getElementById('playhead-filler');
    44   var inner = document.getElementById('playhead-filler');
    45   var base = document.getElementById('playhead');
    45   var base = document.getElementById('playhead');
    46   var multiplier = $(base).Width();
    46   var multiplier = $(base).Width() - 13;
    47   var pos = x - $(inner).Left() + 8;
    47   var pos = x - $(inner).Left() + 8;
    48   pos = 100 * ( pos / multiplier );
    48   pos = 100 * ( pos / multiplier );
    49   set_playback_position(pos);
    49   set_playback_position(pos);
    50 }
    50 }
    51 
    51 
    64   if ( !pos_supported )
    64   if ( !pos_supported )
    65     return false;
    65     return false;
    66   
    66   
    67   // pos needs to be 1-100
    67   // pos needs to be 1-100
    68   var base = document.getElementById('playhead');
    68   var base = document.getElementById('playhead');
    69   var multiplier = $(base).Width();
    69   var multiplier = $(base).Width() - 13;
    70   pos = ( pos / 100 ) * multiplier;
    70   pos = ( pos / 100 ) * multiplier;
    71   var left = pos + $(base).Left();
    71   var left = pos + $(base).Left();
    72   posslide_handle_drag(left, 0, true);
    72   posslide_handle_drag(left, 0, true);
    73 }
    73 }
    74 
    74