|
@@ -2,6 +2,15 @@ $(function () {
|
|
const globaldata = {
|
|
const globaldata = {
|
|
active: null,
|
|
active: null,
|
|
maxlength: null,
|
|
maxlength: null,
|
|
|
|
+ addHandler: function (element, type, handler) {
|
|
|
|
+ if (element.addEventListener) {
|
|
|
|
+ element.addEventListener(type, handler, false);
|
|
|
|
+ } else if (element.attachEvent) {
|
|
|
|
+ element.attachEvent("on" + type, handler);
|
|
|
|
+ } else {
|
|
|
|
+ element["on" + type] = handler;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
};
|
|
};
|
|
// 实现跳转
|
|
// 实现跳转
|
|
$(".my-nav").click(function (e) {
|
|
$(".my-nav").click(function (e) {
|
|
@@ -44,25 +53,42 @@ $(function () {
|
|
// 进度条
|
|
// 进度条
|
|
let showdom = $(".pro>.pro-content");
|
|
let showdom = $(".pro>.pro-content");
|
|
// 显示数值
|
|
// 显示数值
|
|
- let pro_show = $("pro_show");
|
|
|
|
|
|
+ let pro_show = $(".pro>.pro-show");
|
|
movedom.mousedown(function (e) {
|
|
movedom.mousedown(function (e) {
|
|
|
|
+ $(".prog>.title").hide();
|
|
|
|
+ $(".pro>.pro-title").hide();
|
|
startX = e.pageX;
|
|
startX = e.pageX;
|
|
$(this).css('left') ? $(this).css('left') : $(this).css('left', '0px');
|
|
$(this).css('left') ? $(this).css('left') : $(this).css('left', '0px');
|
|
let startLeft = parseInt($(this).css('left'));
|
|
let startLeft = parseInt($(this).css('left'));
|
|
- console.log(startLeft)
|
|
|
|
let $that = $(this);
|
|
let $that = $(this);
|
|
- $(document).mousemove(function (e) {
|
|
|
|
|
|
+ var move = 'ontouchstart' in document ? 'touchstart' : 'mousemove';
|
|
|
|
+ document.onmousemove = function (e) {
|
|
let moveX = (e.pageX - startX) > 0 ? true : false;
|
|
let moveX = (e.pageX - startX) > 0 ? true : false;
|
|
let movesection = startLeft + (e.pageX - startX);
|
|
let movesection = startLeft + (e.pageX - startX);
|
|
if (movesection >= 0 && movesection <= maxlength) {
|
|
if (movesection >= 0 && movesection <= maxlength) {
|
|
- let percent = (movesection / maxlength).toFixed(4) * 100 * gross;
|
|
|
|
|
|
+ let percent = (movesection / maxlength).toFixed(4) * gross;
|
|
percent = Math.round(percent) + "分";
|
|
percent = Math.round(percent) + "分";
|
|
let move = movesection + "px";
|
|
let move = movesection + "px";
|
|
showdom.css("width", move);
|
|
showdom.css("width", move);
|
|
- console.log(percent)
|
|
|
|
pro_show.css("left", move).text(percent);
|
|
pro_show.css("left", move).text(percent);
|
|
$that.css("left", move)
|
|
$that.css("left", move)
|
|
|
|
+ window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
|
|
}
|
|
}
|
|
- })
|
|
|
|
- }).mouseleave(function () { $(document).mousemove = null })
|
|
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ movedom.mouseup(function () { document.onmousemove = null })
|
|
|
|
+ movedom.mouseleave(function () { document.onmousemove = null })
|
|
|
|
+
|
|
|
|
+ // 不能实现的事件
|
|
|
|
+ function warm () {
|
|
|
|
+ alert("请在大联考App内登录后操作")
|
|
|
|
+ }
|
|
|
|
+ // $(".edi-open>span[data-click='open']").click(warm)
|
|
|
|
+ $(".edi-user").click(warm)
|
|
|
|
+ $(".choose").click(warm)
|
|
|
|
+
|
|
|
|
+ // 默认 时间
|
|
|
|
+ $(".pull-right>span").click(function () {
|
|
|
|
+ $(this).addClass('active').siblings("span").removeClass("active");
|
|
|
|
+ })
|
|
})
|
|
})
|