1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| jQuery(function($) {
var slider;
$('.range').each(function(){
var cls = $(this).attr('class');
var elem = $(this).parent();
var options = {
range: "min",
min: -90,
max: 0,
value: -45};
elem.append('<div class="uirange"></div>');
options.slide = function(event, ui){
elem.find('label span').empty().append(ui.value);
elem.find('input').val(ui.value);
// place la bonne valeur dans l'hyperlien avec l'id panoramix
$("#panoramix").attr("href","ptz.cgi?pan=" + ui.value);
}
elem.find('.uirange').slider(options);
elem.find('input').hide();
// quand on relache la souris, provoque le saut vers la page de l'hyperlien panoramix
$('.uirange').mouseup(function() {
window.location.href = $("#panoramix").attr("href") ;
});
});
var slider2;
$('.range2').each(function(){
var cls2 = $(this).attr('class');
var elem2 = $(this).parent();
var options2 = {orientation: "vertical",
range: "min2",
min: -180,
max: 180,
value: 0};
elem2.append('<div class="uirange2"></div>');
options2.slide = function(event, ui){
elem2.find('label2 span2').empty().append(ui.value);
elem2.find('input2').val(ui.value);
// place la bonne valeur dans l'hyperlien avec l'id panoramix
$("#panoramix2").attr("href","ptz.cgi?tilt=" + ui.value);
}
elem2.find('.uirange2').slider(options);
elem2.find('input2').hide();
// quand on relache la souris, provoque le saut vers la page de l'hyperlien panoramix
$('.uirange2').mouseup(function() {
window.location.href = $("#panoramix2").attr("href") ;
});
});
}); |
Partager