Browse Source

commit

master
hehongxing 3 years ago
parent
commit
ab63008e10
  1. BIN
      04.系统编码/App/Content/images/clear-gray.png
  2. 49
      04.系统编码/App/Content/scripts/beijing/play-control.js
  3. 49
      04.系统编码/App/Content/scripts/menggu/play-control.js
  4. 41
      04.系统编码/App/Content/scripts/tiananmen/play-control.js

BIN
04.系统编码/App/Content/images/clear-gray.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

49
04.系统编码/App/Content/scripts/beijing/play-control.js

@ -0,0 +1,49 @@
var PlayControl = function (parent, id) {
this.Self = $(id);
this.Parent = parent;
this.PlayTimer = null;
this.CurrentTimeList = null;
this.PrevButton = this.Self.find('.prev-btn:first');
this.NextButton = this.Self.find('.next-btn:first');
this.PlayButton = this.Self.find('.play-btn:first');
this.PauseButton = this.Self.find('.pause-btn:first');
this.Startup = function () {
this.PrevButton.on('click', this.OnPreButtonClick.bind(this));
this.NextButton.on('click', this.OnNextButtonClick.bind(this));
this.PlayButton.on('click', this.OnPlayButtonClick.bind(this));
this.PauseButton.on('click', this.OnPauseButtonClick.bind(this));
};
this.OnPreButtonClick = function () {
var active = this.CurrentTimeList.find('.active:first');
var prev = active.prev();
if (prev.length === 0)
prev = this.CurrentTimeList.find('li:last');
prev.trigger('click');
};
this.OnNextButtonClick = function () {
var active = this.CurrentTimeList.find('.active:first');
var next = active.next();
if (next.length === 0)
next = this.CurrentTimeList.find('li:first');
next.trigger('click');
};
this.OnPlayButtonClick = function () {
this.PlayTimer = setInterval(this.OnNextButtonClick.bind(this), 1500);
this.PauseButton.parent('.pause').show();
this.PlayButton.parent('.play').hide();
};
this.OnPauseButtonClick = function () {
clearInterval(this.PlayTimer);
this.PauseButton.parent('.pause').hide();
this.PlayButton.parent('.play').show();
};
};

49
04.系统编码/App/Content/scripts/menggu/play-control.js

@ -0,0 +1,49 @@
var PlayControl = function (parent, id) {
this.Self = $(id);
this.Parent = parent;
this.PlayTimer = null;
this.CurrentTimeList = null;
this.PrevButton = this.Self.find('.prev-btn:first');
this.NextButton = this.Self.find('.next-btn:first');
this.PlayButton = this.Self.find('.play-btn:first');
this.PauseButton = this.Self.find('.pause-btn:first');
this.Startup = function () {
this.PrevButton.on('click', this.OnPreButtonClick.bind(this));
this.NextButton.on('click', this.OnNextButtonClick.bind(this));
this.PlayButton.on('click', this.OnPlayButtonClick.bind(this));
this.PauseButton.on('click', this.OnPauseButtonClick.bind(this));
};
this.OnPreButtonClick = function () {
var active = this.CurrentTimeList.find('.active:first');
var prev = active.prev();
if (prev.length === 0)
prev = this.CurrentTimeList.find('li:last');
prev.trigger('click');
};
this.OnNextButtonClick = function () {
var active = this.CurrentTimeList.find('.active:first');
var next = active.next();
if (next.length === 0)
next = this.CurrentTimeList.find('li:first');
next.trigger('click');
};
this.OnPlayButtonClick = function () {
this.PlayTimer = setInterval(this.OnNextButtonClick.bind(this), 1500);
this.PauseButton.parent('.pause').show();
this.PlayButton.parent('.play').hide();
};
this.OnPauseButtonClick = function () {
clearInterval(this.PlayTimer);
this.PauseButton.parent('.pause').hide();
this.PlayButton.parent('.play').show();
};
};

41
04.系统编码/App/Content/scripts/tiananmen/play-control.js

@ -0,0 +1,41 @@
var PlayControl = function (parent) {
this.Parent = parent;
this.Timer = null;
this.Startup = function () {
$('#prev').on('click', this.ActivePrevImage.bind(this));
$('#next').on('click', this.ActiveNextImage.bind(this));
$('#play').on('click', this.OnPlayButtonClick.bind(this));
$('#pause').on('click', this.OnPauseButtonClick.bind(this));
};
this.ActivePrevImage = function () {
var index = parseInt($(".calc-list").attr("index"));
var count = parseInt($(".calc-list").attr("count"));
var prevIndex = index > 0 ? index - 1 : count - 1;
this.Parent.SetActiveImage(prevIndex);
};
this.ActiveNextImage = function () {
var index = parseInt($(".calc-list").attr("index"));
var count = parseInt($(".calc-list").attr("count"));
var nextIndex = index < count - 1 ? index + 1 : 0;
this.Parent.SetActiveImage(nextIndex);
};
this.AutoPlay = function () {
this.Timer = setInterval(this.ActiveNextImage.bind(this), 1500);
};
this.OnPlayButtonClick = function () {
this.AutoPlay();
$('.btn-group div.pause').show();
$('.btn-group div.play').hide();
};
this.OnPauseButtonClick = function () {
clearInterval(this.Timer);
$('.btn-group div.pause').hide();
$('.btn-group div.play').show();
};
};
Loading…
Cancel
Save