zhichao lei před 4 roky
rodič
revize
211bf7f467
3 změnil soubory, kde provedl 87 přidání a 32 odebrání
  1. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Content/bootstrap/bootstrap.min.css
  2. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/scroll/scroll.css
  3. +84
    -29
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/scroll/scroll.js

+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Content/bootstrap/bootstrap.min.css
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/scroll/scroll.css Zobrazit soubor

@@ -17,7 +17,7 @@

.lr-scroll-vertical {
position: absolute;
width: 4px;
width: 10px;
height: 100%;
top: 0;
right: 0;
@@ -50,7 +50,7 @@
.lr-scroll-horizontal {
position: absolute;
width: 100%;
height: 4px;
height: 10px;
bottom: 0;
right: 0;
display: none;


+ 84
- 29
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/plugin/scroll/scroll.js Zobrazit soubor

@@ -1,5 +1,5 @@
/*
* 版 本 Learun-ADMS V7.0.0 数字化智慧校园(http://www.learun.cn)
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2018 上海力 软信息技术有限公司
* 创建人:力 软-前端开发组
* 日 期:2018.04.19
@@ -72,15 +72,17 @@
$this.resize(function () {
var $this = $(this);
var op = $this[0].op;
var h = $this.height();
var w = $this.width();
if (h != op.h) {
op.h = h;
methods.updateY($this);
}
if (w != op.w) {
op.w = w;
methods.updateX($this);
if (op) {
var h = $this.height();
var w = $this.width();
if (h != op.h) {
op.h = h;
methods.updateY($this);
}
if (w != op.w) {
op.w = w;
methods.updateX($this);
}
}
$this = null;
});
@@ -88,9 +90,10 @@
var $this = $(this);
var $scrollWrap = $this.parent();
var op = $scrollWrap[0].op;
var sh = $this.innerHeight();
var sw = $this.innerWidth();
if (op != null && op != undefined) {
if (op) {
var sh = $this.innerHeight();
var sw = $this.innerWidth();

if (sh != op.sh) {
op.sh = sh;
methods.updateY($scrollWrap);
@@ -100,7 +103,6 @@
methods.updateX($scrollWrap);
}
}
$this = null;
$scrollWrap = null;
});
@@ -108,20 +110,43 @@
// 监听鼠标滚动
$this.mousewheel(function (event, delta, deltaX, deltaY) {

console.log(delta);

var $this = $(this);
var $select = $this.find('.lr-select-focus');
if ($select.length > 0) {
var selectId = "learun_select_option_" + $select.attr('id');
$('#' + selectId).slideUp(150);
$select.removeClass('lr-select-focus');
}

var _v = 4 + (Math.abs(delta) - 1) * 0.1 * event.deltaFactor;
if (_v > 16 && _v < 300) {
_v = 16;
}
else if (_v >= 300) {
_v = 20;
}

var op = $this[0].op;
var d = delta * 18;
var d = delta * _v;// var d = delta * 20;
if (op.sh > op.h) {
op.oldsy = op.sy;
op.sy = op.sy - d;
methods.moveY($this, true);
$this = null;
return false;
setTimeout(function () {
methods.moveY($this, true, true);
$this = null;
});
if (op.h + op.sy < op.sh && op.sy > 0) {
return false;
}
} else if (op.sw > op.w) {
op.oldsx = op.sx;
op.sx = op.sx - d;
methods.moveX($this, true);
$this = null;
setTimeout(function () {
methods.moveX($this, true);
$this = null;
});
return false;
}
});
@@ -149,7 +174,16 @@

top.$(document).on('mousemove', { $obj: $this }, function (e) {
var op = e.data.$obj[0].op;

if (op.isYMousedown) {

var $select = e.data.$obj.find('.lr-select-focus');
if ($select.length > 0) {
var selectId = "learun_select_option_" + $select.attr('id');
$('#' + selectId).slideUp(150);
$select.removeClass('lr-select-focus');
}

var y = e.pageY;
var _yd = y - op.yMousedown;
op.yMousedown = y;
@@ -163,10 +197,16 @@
op.blockY = 0;
}
methods.getY(op);
methods.moveY(e.data.$obj);
methods.moveY(e.data.$obj, true);
}
else if (op.isXMousedown) {
var op = e.data.$obj[0].op;
var $select = e.data.$obj.find('.lr-select-focus');
if ($select.length > 0) {
var selectId = "learun_select_option_" + $select.attr('id');
$('#' + selectId).slideUp(150);
$select.removeClass('lr-select-focus');
}

var x = e.pageX;
var _xd = x - op.xMousedown;
op.xMousedown = x;
@@ -292,7 +332,7 @@
$scroll = null;
$horizontal = null;
},
moveY: function ($this, isMousewheel) {
moveY: function ($this, isMousewheel, isCallBack) {
var op = $this[0].op;
var $scroll = $this.find('#' + op.id + '_box');
var $vertical = $this.find('#' + op.id + '_vertical');
@@ -330,7 +370,9 @@
'top': op.blockY + 'px'
});
}
op.callback && op.callback(op.sx, op.sy);
if (isCallBack) {
op.callback && op.callback(op.sx, op.sy);
}
$scroll = null;
$vertical = null;
},
@@ -425,10 +467,13 @@
});
}

$.fn.lrscrollSet = function (name, data) {
$.fn.lrscrollSet = function (name, data, isCallBack) {
var $this = $(this);
if (!$this[0] || !$this[0].op) {
return;
}
switch (name) {
case 'moveRight':
var $this = $(this);
setTimeout(function () {
var op = $this[0].op;
op.oldsx = op.sx;
@@ -438,15 +483,25 @@
}, 250);
break;
case 'moveBottom':
var $this = $(this);
setTimeout(function () {
var op = $this[0].op;
op.oldsy = op.sx;
op.oldsy = op.sy;
op.sy = op.sh - op.h;
methods.moveY($this, true);
methods.moveY($this, true, isCallBack);
$this = null;
}, 250);
break;
case 'moveY':
setTimeout(function () {
var op = $this[0].op;
op.oldsy = op.sy;
op.sy = data;
methods.moveY($this, true, isCallBack);
$this = null;
});
break;
case 'moveX':
break;
}
}


Načítá se…
Zrušit
Uložit