You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB

3 years ago
var Slider = function (parent) {
this.Parent = parent;
3 years ago
this.PlayControl = new PlayControl(this);
3 years ago
this.Startup = function () {
3 years ago
3 years ago
$(".calc-list").attr("count", $(".calc-list ul").find('li').length);
$(".calc-list ul").find('li').each(function (index, element) {
$(element).attr('index', index);
});
$(".calc-list ul li").on('click', this.OnThumbImageClick.bind(this));
3 years ago
this.PlayControl.Startup();
3 years ago
var now = new Date();
this.SetActiveImage(now.getHours());
};
this.SetActiveImage = function (index) {
3 years ago
$(".calc-list ul").find('li.active').removeClass("active");
$(".calc-list ul").find('li').eq(index).addClass("active");
3 years ago
$(".calc-list").attr("index", index);
3 years ago
var selected = $(".calc-list ul").find('li.active');
3 years ago
this.Parent.Map.ReloadData(selected.attr('time'));
};
3 years ago
3 years ago
this.OnThumbImageClick = function (e) {
var index = $(e.target).attr("index");
this.SetActiveImage(index);
3 years ago
$('.calc-list ul li').removeClass("active");
$(e.target).addClass("active");
3 years ago
};
};