锘縤f (!$.browser.msie || $.browser.msie && $.browser.version * 1 > 10) { //涓嬮洩鏂规硶 (function (a) { function g() { var b, a = {}; for (type in{ Top: "", Left: "" }) b = "Top" == type ? "Y" : "X", "undefined" != typeof window["page" + b + "Offset"] ? a[type.toLowerCase()] = window["page" + b + "Offset"] : (b = document.documentElement.clientHeight ? document.documentElement : document.body, a[type.toLowerCase()] = b["scroll" + type]); return a } function o(a) { this.parent = document.body, this.createEl(this.parent, a), this.size = 5 * Math.random() + 5, this.el.style.width = Math.round(this.size) + "px", this.el.style.height = Math.round(this.size) + "px", this.maxLeft = document.body.offsetWidth - this.size, this.maxTop = document.body.offsetHeight - this.size, this.left = Math.random() * this.maxLeft, this.top = g().top + 1, this.angle = 1.4 + .2 * Math.random(), this.minAngle = 1.4, this.maxAngle = 1.6, this.angleDelta = .01 * Math.random(), this.speed = 2 + Math.random() } var b = window, d = function () { var a = document.createElement("canvas"); return "function" == typeof a.getContext }; window.Snow = function (a, b) { !function () { var c, b = ["webkit", "moz"]; for (c = 0; c < b.length && !window.requestAnimationFrame; ++c) window.requestAnimationFrame = window[b[c] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[b[c] + "CancelAnimationFrame"] || window[b[c] + "CancelRequestAnimationFrame"]; window.requestAnimationFrame || (window.requestAnimationFrame = function (a) { var c = 14, d = window.setTimeout(function () { a(c) }, c); return d }), window.cancelAnimationFrame || (window.cancelAnimationFrame = function (a) { clearTimeout(a) }) }(), this.settings = b, this.flakes = [], this.flakeCount = b.count, this.mx = -100, this.my = -100, this.init(a) }, Snow.prototype.init = function (c) { var d, e, f, g, h, i; for (this.canvas = c.get(0), this.ctx = this.canvas.getContext("2d"), this.canvas.width = b.innerWidth, this.canvas.height = a(c.get(0)).attr("height"), this.flakes = [], d = 0; d < this.flakeCount; d++) e = Math.floor(Math.random() * this.canvas.width), f = Math.floor(Math.random() * this.canvas.height), g = Math.floor(100 * Math.random()) % this.settings.size + 2, h = Math.floor(100 * Math.random()) % this.settings.speed + Math.random() * g / 10 + .5, i = .5 * Math.random() + this.settings.opacity, this.flakes.push({ speed: h, velY: h, velX: 0, x: e, y: f, size: g, stepSize: Math.random() / 30, step: 0, angle: 180, opacity: i }); 1 == this.settings.interaction && this.canvas.addEventListener("mousemove", function (a) { this.mx = a.clientX, this.my = a.client }), "string" == typeof this.settings.image && (this.image = a("")), this.snow() }, Snow.prototype.snow = function () { var a = this, c = function () { var d, e, f, g, h, i, j, k, l, m, n, o, p; for (a.ctx.clearRect(0, 0, a.canvas.width, a.canvas.height), d = 0; d < a.flakeCount; d++) { if (e = a.flakes[d], f = a.mx, g = a.my, h = 100, i = e.x, j = e.y, k = Math.sqrt((i - f) * (i - f) + (j - g) * (j - g)), h > k) l = h / (k * k), m = (f - i) / k, n = (g - j) / k, o = l / 2, e.velX -= o * m, e.velY -= o * n; else switch (e.velX *= .98, e.velY <= e.speed && (e.velY = e.speed), a.settings.windPower) { case!1: e.velX += Math.cos(e.step += .05) * e.stepSize; break; case 0: e.velX += Math.cos(e.step += .05) * e.stepSize; break; default: e.velX += .01 + a.settings.windPower / 100 } e.y += e.velY, e.x += e.velX, (e.y >= a.canvas.height || e.y <= 0) && a.resetFlake(e), (e.x >= a.canvas.width || e.x <= 0) && a.resetFlake(e), 0 == a.settings.image ? (p = a.ctx.createRadialGradient(e.x, e.y, 0, e.x, e.y, e.size - 1), p.addColorStop(0, a.settings.startColor), p.addColorStop(1, a.settings.endColor), a.ctx.fillStyle = p, a.ctx.beginPath(), a.ctx.arc(e.x, e.y, e.size, 0, 2 * Math.PI), a.ctx.fill()) : a.ctx.drawImage(a.image.get(0), e.x, e.y, 2 * e.size, 2 * e.size) } b.cancelAnimationFrame(c), b.requestAnimationFrame(c) }; c() }, Snow.prototype.resetFlake = function (a) { var b, c, d, e; 0 == this.settings.windPower || 0 == this.settings.windPower ? (a.x = Math.floor(Math.random() * this.canvas.width), a.y = 0) : this.settings.windPower > 0 ? (b = Array(Math.floor(Math.random() * this.canvas.width), 0), c = Array(0, Math.floor(Math.random() * this.canvas.height)), d = Array(b, c), e = d[Math.floor(Math.random() * d.length)], a.x = e[0], a.y = e[1]) : (b = Array(Math.floor(Math.random() * this.canvas.width), 0), c = Array(this.canvas.width, Math.floor(Math.random() * this.canvas.height)), d = Array(b, c), e = d[Math.floor(Math.random() * d.length)], a.x = e[0], a.y = e[1]), a.size = Math.floor(100 * Math.random()) % this.settings.size + 2, a.speed = Math.floor(100 * Math.random()) % this.settings.speed + Math.random() * a.size / 10 + .5, a.velY = a.speed, a.velX = 0, a.opacity = .5 * Math.random() + this.settings.opacity }, a.fn.canvasSnow = function () { var b = d(); b && a(this).each(function (b, c) { var d = {}; a.each(c.attributes, function (b, c) { d[a.camelCase(c.name)] = Number(Number(c.value)) ? Number(c.value) : c.value }), "string" == typeof d.image && "false" === d.image && (d.image = !1), new Snow(a(c), { speed: 1, interaction: d.interaction || !0, size: d.size || 2, count: d.count || 200, opacity: d.opacity || 1, startColor: d.startColor || "rgba(255,255,255,1)", endColor: d.endColor || "rgba(255,255,255,0)", windPower: d.windPower || 0, image: d.image || !1 }) }) }, o.prototype = { createEl: function (a, b) { this.el = document.createElement("img"), this.el.classname = "nicesnowclass", this.el.setAttribute("src", b || ""), this.el.style.position = "absolute", this.el.style.display = "block", this.el.style.zIndex = "99999", this.parent.appendChild(this.el) }, move: function () { (this.angle < this.minAngle || this.angle > this.maxAngle) && (this.angleDelta = -this.angleDelta), this.angle += this.angleDelta, this.left += this.speed * Math.cos(this.angle * Math.PI), this.top -= this.speed * Math.sin(this.angle * Math.PI), this.left < 0 ? this.left = this.maxLeft : this.left > this.maxLeft && (this.left = 0) }, draw: function () { this.el.style.top = Math.round(this.top) + "px", this.el.style.left = Math.round(this.left) + "px" }, remove: function () { this.parent.removeChild(this.el), this.parent = this.el = null } } })(jQuery); //娴佹槦 (function (a) { function n(e, f) { var g = a(e), i = document.createElement("canvas"); g.append(i), i.width = f.width || window.innerWidth, i.height = f.height || window.innerHeight, i.className = "meteor-canvas", c = i.height, d = i.width, b = i.getContext("2d"), b.fillStyle = "black", 100 > d / h && (j = 100) } function p() { for (var a = 0; f > a; a++) e[a].getColor(), e[a].draw(); clearTimeout(l), l = setTimeout(p, 200) } function r() { var a, d; for (a = 0; h > a; a++) d = g[a], d.move(), d.y > c + 100 && (b.clearRect(d.x, d.y - d.height, d.width, d.height), i[a] = 0, g[a] = new q(a), g[a].init(a)); clearTimeout(k), k = setTimeout(r, 10) } var b, c, d, k, l, q, e = [], f = 200, g = [], h = 3, i = [], j = 200, m = function () { var a = document.createElement("canvas"); return "function" == typeof a.getContext }, o = function () { this.x = d * Math.random(), this.y = 5e3 * Math.random(), this.text = ".", this.color = "white" }; o.prototype = { constructor: o, getColor: function () { var a = Math.random(); this.color = .5 > a ? "gray" : "white" }, init: function () { this.getColor() }, draw: function () { b.beginPath(), b.arc(this.x, this.y, .05, 0, 2 * Math.PI), b.strokeStyle = this.color, b.stroke(), b.closePath() } }, q = function () { this.x = -1, this.y = -1, this.length = -1, this.angle = 30, this.width = -1, this.height = -1, this.speed = 1, this.offset_x = -1, this.offset_y = -1, this.alpha = 1, this.color1 = "", this.color2 = "" }, q.prototype = { constructor: q, init: function (a) { var b, c, d; this.getPos(a), this.alpha = 1, b = 80 * Math.random() + 180, this.length = Math.ceil(b), this.angle = 30, b = Math.random() + .5, this.speed = Math.ceil(b), c = Math.cos(3.14 * this.angle / 180), d = Math.sin(3.14 * this.angle / 180), this.width = this.length * c, this.height = this.length * d, this.offset_x = 3.5 * this.speed * c, this.offset_y = 3.5 * this.speed * d }, countPos: function () { this.x = this.x - this.offset_x, this.y = this.y + this.offset_y }, getPos: function (a) { function b() { if (_this.x = Math.random() * d, i.length) for (var c = 0; c < i.length; c++) if (Math.abs(_this.x - i[c]) < j) return b(); i[a] = _this.x } _this = this, b(), this.y = .2 * c }, draw: function () { b.save(), b.beginPath(), b.lineWidth = 2.5, b.globalAlpha = this.alpha; var a = b.createLinearGradient(this.x, this.y, this.x + this.width, this.y - this.height); a.addColorStop(0, "rgba(255, 255, 255, 1)"), a.addColorStop(1, "rgba(255, 255,255 , 0)"), this.alpha < 0 && (this.alpha = -this.alpha), b.strokeStyle = a, b.moveTo(this.x, this.y), b.lineTo(this.x + this.width, this.y - this.height), b.closePath(), b.stroke(), b.restore() }, move: function () { this.x + this.width - this.offset_x; var c = this.y - this.height; this.alpha -= .002, this.countPos(), this.alpha <= 0 ? this.alpha = 0 : this.alpha > 1 && (this.alpha = 1), b.clearRect(this.x - this.offset_x, c, this.width + this.offset_x, this.height), this.draw() } }, a.fn.extend({ canvasMeteor: function (b) { var c = m(); b = b || {}, e = [], g = [], c && a(this).each(function (a, c) { var d, i; for (n(c, b), a = 0; f > a; a++) d = new o, d.init(), d.draw(), e.push(d); for (a = 0; h > a; a++) i = new q(a), i.init(a), i.draw(), g.push(i); p(), r() }) } }) })(jQuery); //鐑熻姳 (function (a) { var b = function () { var a = document.createElement("canvas"); return "function" == typeof a.getContext }, c = function (a, b) { return ~~(Math.random() * (b - a + 1) + a) }, d = function (a, b, c, d, e, f, g, h) { return !(e > a + c || a > e + g || f > b + d || b > f + h) }, e = function () { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (a) { window.setTimeout(a, 1e3 / 60) } }(), f = function (b, c) { this.canvas = document.createElement("canvas"), this.canvas.width = this.cw = c.width || a(window).innerWidth(), this.canvas.height = this.ch = c.height || a(window).innerHeight(), this.particles = [], this.partCount = 150, this.fireworks = [], this.mx = this.cw / 2, this.my = this.ch / 2, this.currentHue = 30, this.partSpeed = 5, this.partSpeedVariance = 10, this.partWind = 50, this.partFriction = 5, this.partGravity = 1, this.hueMin = 0, this.hueMax = 360, this.fworkSpeed = 4, this.fworkAccel = 10, this.hueVariance = 30, this.flickerDensity = 25, this.showShockwave = !0, this.showTarget = !1, this.clearAlpha = 25, a(b).append(this.canvas), this.canvas.className = "fireworks-canvas", this.ctx = this.canvas.getContext("2d"), this.ctx.lineCap = "round", this.ctx.lineJoin = "round", this.lineWidth = 1, this.bindEvents(), this.canvasLoop() }; f.prototype = { constructor: f, createParticles: function (a, b, d) { for (var f, e = this.partCount; e--;) f = { x: a, y: b, coordLast: [{x: a, y: b}, {x: a, y: b}, {x: a, y: b}], angle: c(0, 360), speed: c(this.partSpeed - this.partSpeedVariance <= 0 ? 1 : this.partSpeed - this.partSpeedVariance, this.partSpeed + this.partSpeedVariance), friction: 1 - this.partFriction / 100, gravity: this.partGravity / 2, hue: c(d - this.hueVariance, d + this.hueVariance), brightness: c(50, 80), alpha: c(40, 100) / 100, decay: c(10, 50) / 1e3, wind: (c(0, this.partWind) - this.partWind / 2) / 25, lineWidth: this.lineWidth }, this.particles.push(f) }, updateParticles: function () { for (var b, c, e, f, a = this.particles.length; a--;) b = this.particles[a], c = b.angle * Math.PI / 180, e = Math.cos(c) * b.speed, f = Math.sin(c) * b.speed, b.speed *= b.friction, b.coordLast[2].x = b.coordLast[1].x, b.coordLast[2].y = b.coordLast[1].y, b.coordLast[1].x = b.coordLast[0].x, b.coordLast[1].y = b.coordLast[0].y, b.coordLast[0].x = b.x, b.coordLast[0].y = b.y, b.x += e, b.y += f, b.y += b.gravity, b.angle += b.wind, b.alpha -= b.decay, (!d(0, 0, this.cw, this.ch, b.x - b.radius, b.y - b.radius, 2 * b.radius, 2 * b.radius) || b.alpha < .05) && this.particles.splice(a, 1) }, drawParticles: function () { for (var b, d, e, f, a = this.particles.length; a--;) b = this.particles[a], d = c(1, 3) - 1, this.ctx.beginPath(), this.ctx.moveTo(Math.round(b.coordLast[d].x), Math.round(b.coordLast[d].y)), this.ctx.lineTo(Math.round(b.x), Math.round(b.y)), this.ctx.closePath(), this.ctx.strokeStyle = "hsla(" + b.hue + ", 100%, " + b.brightness + "%, " + b.alpha + ")", this.ctx.stroke(), this.flickerDensity > 0 && (e = 50 - this.flickerDensity, c(0, e) === e && (this.ctx.beginPath(), this.ctx.arc(Math.round(b.x), Math.round(b.y), c(b.lineWidth, b.lineWidth + 3) / 2, 0, 2 * Math.PI, !1), this.ctx.closePath(), f = c(50, 100) / 100, this.ctx.fillStyle = "hsla(" + b.hue + ", 100%, " + b.brightness + "%, " + f + ")", this.ctx.fill())) }, createFireworks: function (a, b, d, e) { var f = { x: a, y: b, startX: a, startY: b, hitX: !1, hitY: !1, coordLast: [{x: a, y: b}, {x: a, y: b}, {x: a, y: b}], targetX: d, targetY: e, speed: this.fworkSpeed, angle: Math.atan2(e - b, d - a), shockwaveAngle: Math.atan2(e - b, d - a) + 90 * (Math.PI / 180), acceleration: this.fworkAccel / 100, hue: this.currentHue, brightness: c(50, 80), alpha: c(50, 100) / 100, lineWidth: this.lineWidth }; this.fireworks.push(f) }, updateFireworks: function () { for (var b, a = this.fireworks.length; a--;) b = this.fireworks[a], this.ctx.lineWidth = b.lineWidth, vx = Math.cos(b.angle) * b.speed, vy = Math.sin(b.angle) * b.speed, b.speed *= 1 + b.acceleration, b.coordLast[2].x = b.coordLast[1].x, b.coordLast[2].y = b.coordLast[1].y, b.coordLast[1].x = b.coordLast[0].x, b.coordLast[1].y = b.coordLast[0].y, b.coordLast[0].x = b.x, b.coordLast[0].y = b.y, b.startX >= b.targetX ? b.x + vx <= b.targetX ? (b.x = b.targetX, b.hitX = !0) : b.x += vx : b.x + vx >= b.targetX ? (b.x = b.targetX, b.hitX = !0) : b.x += vx, b.startY >= b.targetY ? b.y + vy <= b.targetY ? (b.y = b.targetY, b.hitY = !0) : b.y += vy : b.y + vy >= b.targetY ? (b.y = b.targetY, b.hitY = !0) : b.y += vy, b.hitX && b.hitY && (this.createParticles(b.targetX, b.targetY, b.hue), this.fireworks.splice(a, 1)) }, drawFireworks: function () { var b, d, a = this.fireworks.length; for (this.ctx.globalCompositeOperation = "lighter"; a--;) b = this.fireworks[a], this.ctx.lineWidth = b.lineWidth, d = c(1, 3) - 1, this.ctx.beginPath(), this.ctx.moveTo(Math.round(b.coordLast[d].x), Math.round(b.coordLast[d].y)), this.ctx.lineTo(Math.round(b.x), Math.round(b.y)), this.ctx.closePath(), this.ctx.strokeStyle = "hsla(" + b.hue + ", 100%, " + b.brightness + "%, " + b.alpha + ")", this.ctx.stroke(), this.showTarget && (this.ctx.save(), this.ctx.beginPath(), this.ctx.arc(Math.round(b.targetX), Math.round(b.targetY), c(1, 8), 0, 2 * Math.PI, !1), this.ctx.closePath(), this.ctx.lineWidth = 1, this.ctx.stroke(), this.ctx.restore()), this.showShockwave && (this.ctx.save(), this.ctx.translate(Math.round(b.x), Math.round(b.y)), this.ctx.rotate(b.shockwaveAngle), this.ctx.beginPath(), this.ctx.arc(0, 0, 1 * (b.speed / 5), 0, Math.PI, !0), this.ctx.strokeStyle = "hsla(" + b.hue + ", 100%, " + b.brightness + "%, " + c(25, 60) / 100 + ")", this.ctx.lineWidth = b.lineWidth, this.ctx.stroke(), this.ctx.restore()) }, bindEvents: function () { function d() { a.mx = a.canvas.width * Math.random() - a.canvas.offsetLeft, a.my = a.canvas.height * Math.random() - a.canvas.offsetTop, a.currentHue = c(a.hueMin, a.hueMax), a.createFireworks(a.cw / 2, a.ch, a.mx, a.my), setTimeout(function () { e(d.bind(a)) }, 500) } var a = this; a.clear(), e(d.bind(a)) }, clear: function () { this.particles = [], this.fireworks = [], this.ctx.clearRect(0, 0, this.cw, this.ch) }, canvasLoop: function () { var a = this; e(this.canvasLoop.bind(a), this.canvas), this.ctx.globalCompositeOperation = "destination-out", this.ctx.fillStyle = "rgba(0, 0, 0, " + this.clearAlpha / 100 + ")", this.ctx.fillRect(0, 0, this.cw, this.ch), this.updateFireworks(), this.updateParticles(), this.drawFireworks(), this.drawParticles() } }, a.fn.extend({ canvasFireworks: function (c) { var d = b(); c = c || {}, d && a(this).each(function (a, b) { new f(b, c) }) } }) })(jQuery); //涓嬮洦 (function (a) { function b() { this.dir = 3, this.height = 30, this.count = 100 } b.prototype.init = function () { var a = this; a.canvas = document.createElement("canvas"), a.canvas.width = a.W = a.curDom.width(), a.canvas.height = a.H = a.curDom.height(), a.curDom.append(a.canvas), a.ctx = a.canvas.getContext("2d"), setInterval(function () { a.clearCanvas() }, 100) }, b.prototype.clearCanvas = function () { var a = this; a.ctx.clearRect(0, 0, a.W, a.H), a.draws() }, b.prototype.draw = function (a, b) { var c = this, d = c.ctx, e = c.ctx.createLinearGradient(a, b, a - c.dir, b + c.height); e.addColorStop(0, "rgba(0,0,0,0)"), e.addColorStop(.5, "rgba(105,105,105,0.2)"), e.addColorStop(1, "rgba(255,255,255,0.8)"), d.strokeStyle = e, d.beginPath(), d.moveTo(a, b), d.lineTo(a - c.dir, b + c.height), d.lineWidth = 2, d.stroke(), d.closePath() }, b.prototype.draws = function () { var b, a = this; for (b = 1; b <= a.count; b++) a.draw(Math.random() * a.W, Math.random() * a.H) }, a.fn.extend({ canvasRain: function (c) { var d = new b; d.curDom = a(this), c && (c.dir && (d.dir = c.dir), c.height && (d.height = c.height), c.count && (d.count = c.count)), d.init() } }) })(jQuery); //姘旀场 (function ($) { $.fn.canvasAirBubble = function (options) { var curDom = $(this), width = curDom.width(), height = curDom.height(), canvas, ctx, target, animateHeader = true, circles = [], settings = $.extend({ color: 'rgba(255,255,255,.4)', radius: 20, densety: 0.3, clearOffset: 0.2 }, options); initContainer(); function initContainer() { target = {x: 0, y: height}; initCanvas(); canvas = document.getElementById('canvas'); canvas.width = width; canvas.height = height; ctx = canvas.getContext('2d'); for (var x = 0; x < width * settings.densety; x++) { var c = new Circle(); circles.push(c) } animate() } function initCanvas() { var canvasElement = document.createElement('canvas'); canvasElement.id = 'canvas'; curDom.append(canvasElement) } function animate() { if (animateHeader) { ctx.clearRect(0, 0, width, height); for (var i in circles) { circles[i].draw() } } requestAnimationFrame(animate) } function randomColor() { return "rgba(" + Math.floor(Math.random() * 255) + "," + Math.floor(Math.random() * 255) + "," + Math.floor(Math.random() * 255) + "," + Math.random().toPrecision(2) + ")" } function Circle() { var self = this; (function () { self.pos = {}; init() })(); function init() { self.pos.x = Math.random() * width; self.pos.y = height + Math.random() * 100; self.alpha = 0.1 + Math.random() * settings.clearOffset; self.scale = 0.1 + Math.random() * 0.3; self.speed = Math.random(); if (settings.color == 'random') { self.color = randomColor() } else { self.color = settings.color } } this.draw = function () { if (self.alpha <= 0) { init() } self.pos.y -= self.speed; self.alpha -= 0.0005; ctx.beginPath(); ctx.arc(self.pos.x, self.pos.y, self.scale * settings.radius, 0, 2 * Math.PI, false); ctx.fillStyle = self.color; ctx.fill(); ctx.closePath() } } } })(jQuery); } /**************** 鍓嶅彴椤甸潰鍏敤鐨刯s鏂规硶 *******************/ /*Banner3D鐨勬彃浠?/ ;(function($) { function Banner3D(curDom) { var that = this; that.curDom = curDom; that.curDomType = that.curDom.hasClass('customModuleRowGroup') ? 'rowGroup' : 'banner'; that.effectType = that.curDom.attr('data-effect-type'); that.autoTime = (that.curDomType === 'rowGroup' && is_action) ? null : that.curDom.attr('data-auto-time') * 1000; that.autoTimeFun = null; that.durationTime = that.curDom.attr('data-duration-time') * 1000; that.canvasType = that.curDom.attr('data-canvas-type'); that.piclistArea = that.curDomType === 'rowGroup' ? that.curDom.find(".rowGroup-box") : that.curDom.find(".piclist-area"); that.piclistBox = that.curDomType === 'rowGroup' ? that.curDom.find(".rowGroup-box-inner") : that.curDom.find(".piclist-box"); that.btnArea = that.curDom.children(".ctrl-btn-area"); that.sidebarArea = that.curDom.children(".ctrl-sidebar-area"); that.smallpicObj = { 'area': that.curDom.children(".smallpic-area") }; that.liArray = that.curDomType === 'rowGroup' ? that.curDom.find(".customModuleRow") : that.piclistBox.find(".list-item"); that.sumLi = that.liArray.length; that.curLiIndex = null; that.curLi = null; that.defaultLi = that.curDom.attr('data-showsum') || 0; that.effectKey = 0; that.targetIndex = 0; } Banner3D.prototype.init = function() { var that = this, curClass = 'cur'; that.liArray.css({ 'animation-duration': that.durationTime + 'ms' }); that.liArray.eq(that.defaultLi).addClass(curClass); that.liArray.each(function(i, dom) { dom = $(dom); dom.data('loaded', 0).attr('data-loaded', 0); if (dom.hasClass(curClass)) { that.curLiIndex = that.targetIndex = i; that.curLi = dom; that.sidebarArea.length && that.sidebarArea.find('em').eq(i).addClass('cur'); that.smallpicObj.area.length && that.smallpicObj.area.find('em').eq(i).addClass('cur'); that.loadImg(); } }); that.btnArea.length && that.btnArea.on({ click: function() { var atcion = $(this).attr('data-action'); that.effectKey = atcion == 'next' ? 1 : 0; that.initFun(that.curLiIndex + (atcion == 'next' ? +1 : -1)); } }, '.btn'); that.sidebarArea.length && that.sidebarArea.on({ click: function() { var $this = $(this); that.autoTime = null; that.autoTimeFun && clearTimeout(that.autoTimeFun); if (!$this.hasClass('cur')) { var index = $this.index(); that.effectKey = index > that.curLiIndex ? 1 : 0; that.initFun(index); } } }, 'em'); that.curDom.on({ 'mouseenter': function() { that.autoTime = null; clearTimeout(that.autoTimeFun); }, 'mouseleave': function() { that.autoTime = (that.curDomType === 'rowGroup' && is_action) ? null : that.curDom.attr('data-auto-time') * 1000; that.autoPlay(); } }); // 鐒︾偣鍥剧壒鍑哄鐞 if (that.curDomType === 'banner') { if (that.smallpicObj.area.length) { that.smallpicObj.area.on({ click: function() { var $this = $(this); that.autoTime = null; that.autoTimeFun && clearTimeout(that.autoTimeFun); if (!$this.hasClass('cur')) { var index = $this.index(); that.effectKey = index > that.curLiIndex ? 1 : 0; that.initFun(index); } } }, 'em'); that.smallpicAnimation(); } wsf.banner3D.canvasLoad(that.curDom); } that.autoPlay(); }; Banner3D.prototype.loadImg = function() { var that = this; if(that.curLi.length){ if(that.curLi.attr('data-loaded') * 1 !== 1){ that.curLi.attr('data-loaded', 1); if (that.curDomType === 'rowGroup') { that.curLi.find('.ev-module-edit,.customModule').each(function(i, dom) { wsf.f.upJsFun($(dom)); }); } else { var img = new Image(), picItem = that.curLi.find('.pic-item'); picItem.addClass('loading-pic'); if (picItem.data('title')) { picItem.attr('title', picItem.data('title')); } img.onload = function() { picItem.css('background-image', 'url(' + picItem.data('imgurl') + ')'); img = null; picItem.removeClass('loading-pic'); }; img.src = picItem.data('imgurl'); } } if (that.curDomType === 'rowGroup') { setTimeout(function(){ that.curLi.find('.ev-module-edit,.customModule').each(function(i, dom) { dom = $(dom); var curDomEditBox = dom; if (dom.hasClass('ev-module-edit')) { curDomEditBox = dom.find('div.ev-module-edit-box:first') } if (curDomEditBox.data('animate-name')) { wsf.f.annimationLoadMo(curDomEditBox); } wsf.f.imgLazyLoading(dom); }); that.liArray.each(function(i, rowDom) { rowDom = $(rowDom); if (!rowDom.is(that.curLi)) { rowDom.find('.ev-module-edit,.customModule').each(function(i, dom) { dom = $(dom); var curDomEditBox = dom; if (dom.hasClass('ev-module-edit')) { curDomEditBox = dom.find('div.ev-module-edit-box:first'); } if (curDomEditBox.data('animate-name')) { curDomEditBox.attr('data-loadanimate', 0); curDomEditBox.addClass('load-animate'); } }); } }); },that.durationTime); } } }; Banner3D.prototype.smallpicAnimation = function() { var that = this; if (!that.smallpicObj.inner) { that.smallpicObj.areaW = that.smallpicObj.area.width(); that.smallpicObj.areaH = that.smallpicObj.area.height(); that.smallpicObj.inner = that.smallpicObj.area.find('.smallpic-inner'); that.smallpicObj.inner.data('translateX', 0); that.smallpicObj.emArray = that.smallpicObj.inner.find('em'); if ($.inArray(that.smallpicObj.area.attr('data-skin') * 1, [151, 152]) == -1) { that.smallpicObj.innerW = (function() { var w = that.smallpicObj.areaW, w_ = 0; that.smallpicObj.emArray.each(function(i, dom) { dom = $(dom); w_ += dom.width(); }); return Math.max(w, w_); })(); that.smallpicObj.inner.width(that.smallpicObj.innerW); } } if ($.inArray(that.smallpicObj.area.attr('data-skin') * 1, [151, 152]) == -1) { if (that.smallpicObj.areaW < that.smallpicObj.innerW) { (function() { var cz = that.smallpicObj.innerW - that.smallpicObj.areaW, curEm = that.smallpicObj.emArray.eq(that.targetIndex), left = curEm.position().left, x = 0; if (left < 0 || left + curEm.width() > that.smallpicObj.areaW) { x = that.smallpicObj.inner.data('translateX') + (left < 0 ? Math.abs(left) : -(curEm.width() + left - that.smallpicObj.areaW)); left < 0 ? (x > 0 && (x = 0)) : ((Math.abs(x) > that.smallpicObj.innerW - that.smallpicObj.areaW) && (x = -(that.smallpicObj.innerW - that.smallpicObj.areaW))); that.smallpicObj.inner.data('translateX', x); that.smallpicObj.inner.css({ 'transform': 'translateX(' + x + 'px)' }); } })(); } } }; Banner3D.prototype.initFun = function(targetIndex) { var that = this; if(is_action && that.curDomType === 'rowGroup'){ that.liArray = that.curDom.find(".customModuleRow"); that.sumLi = that.liArray.length; that.effectType = that.curDom.attr('data-effect-type'); that.targetIndex = that.curLiIndex = that.curDom.find(".customModuleRow.cur").index(); } // that.autoTime != null && that.curDom.attr('data-auto-time') * 1000; if (that.durationTime != that.curDom.attr('data-duration-time') * 1000) { that.durationTime = that.curDom.attr('data-duration-time') * 1000; that.liArray.css({ 'animation-duration': that.durationTime + 'ms' }); } if (that.targetIndex == that.curLiIndex && that.sumLi > 1) { that.targetIndex = ((targetIndex == that.sumLi && '0') || (targetIndex < 0 && (that.sumLi - 1)) || targetIndex) * 1; that.curLi = $(that.liArray[that.targetIndex]); if ($.browser.msie && $.inArray($.browser.version, ['6.0', '7.0', '8.0', '9.0', '10.0']) != -1) { that.IEanimationFun((that.effectType == 0 && Math.floor(Math.random() * 3 + 1)) || that.effectType * 1); } else { that.animationFun((that.effectType == 0 && Math.floor(Math.random() * 8 + 1)) || that.effectType * 1); } that.loadImg(); } }; Banner3D.prototype.effectJson = { 1: [ ['bannerEffect-1-1-out', 'bannerEffect-1-1-in'], ['bannerEffect-1-2-out', 'bannerEffect-1-2-in'] ], 2: [ ['bannerEffect-2-1-out', 'bannerEffect-2-1-in'], ['bannerEffect-2-2-out', 'bannerEffect-2-2-in'] ], 3: [ ['bannerEffect-3-out', 'bannerEffect-3-in'], ['bannerEffect-3-out', 'bannerEffect-3-in'] ], 4: [ ['bannerEffect-4-1-out', 'bannerEffect-4-1-in'], ['bannerEffect-4-2-out', 'bannerEffect-4-2-in'] ], 5: [ ['bannerEffect-5-1-out', 'bannerEffect-5-1-in'], ['bannerEffect-5-2-out', 'bannerEffect-5-2-in'] ], 6: [ ['bannerEffect-6-1-out', 'bannerEffect-6-1-in'], ['bannerEffect-6-2-out', 'bannerEffect-6-2-in'] ], 7: [ ['bannerEffect-7-1-out', 'bannerEffect-7-1-in'], ['bannerEffect-7-2-out', 'bannerEffect-7-2-in'] ], 8: [ ['bannerEffect-8-1-out', 'bannerEffect-8-1-in'], ['bannerEffect-8-2-out', 'bannerEffect-8-2-in'] ] }; Banner3D.prototype.animationFun = function(types) { var that = this, effectKey = that.effectKey, liArray = that.liArray, effectJson = that.effectJson; that.sidebarArea.length && that.sidebarArea.find('em').removeClass('cur').eq(that.targetIndex).addClass('cur'); that.smallpicObj.area.length && (that.smallpicObj.area.find('em').removeClass('cur').eq(that.targetIndex).addClass('cur'), that.smallpicAnimation()); that.piclistArea.attr('class', (that.curDomType === 'rowGroup' ? 'rowGroup-box' : 'piclist-area') + ' bannerEffect-' + types); switch (types) { case 6: liArray.css({ '-webkit-transform-origin': '50% 50% -' + (that.piclistArea.width() / 2) + 'px', '-moz-transform-origin': '50% 50% -' + (that.piclistArea.width() / 2) + 'px', '-ms-transform-origin': '50% 50% -' + (that.piclistArea.width() / 2) + 'px', '-o-transform-origin': '50% 50% -' + (that.piclistArea.width() / 2) + 'px', 'transform-origin': '50% 50% -' + (that.piclistArea.width() / 2) + 'px' }); break; case 7: liArray.css({ '-webkit-transform-origin': '50% 50% -' + (that.piclistArea.height() / 2) + 'px', '-moz-transform-origin': '50% 50% -' + (that.piclistArea.height() / 2) + 'px', '-ms-transform-origin': '50% 50% -' + (that.piclistArea.height() / 2) + 'px', '-o-transform-origin': '50% 50% -' + (that.piclistArea.height() / 2) + 'px', 'transform-origin': '50% 50% -' + (that.piclistArea.height() / 2) + 'px' }); break; default: liArray.css({ '-webkit-transform-origin': '50% 50%', '-moz-transform-origin': '50% 50%', '-ms-transform-origin': '50% 50%', '-o-transform-origin': '50% 50%', 'transform-origin': '50% 50%' }); break; } switch (types) { case 1: case 2: case 3: case 6: case 7: case 8: liArray.eq(that.curLiIndex).addClass(effectJson[types][effectKey][0]); liArray.eq(that.targetIndex).addClass('cur ' + effectJson[types][effectKey][1]); setTimeout(function() { that.curDomType !== 'rowGroup' && (function() { var curVideo = liArray.eq(that.curLiIndex).find('video'), nextVideo = liArray.eq(that.targetIndex).find('video'); curVideo.length && curVideo.attr('src') != 'none' && curVideo[0].pause(); nextVideo.length && nextVideo.attr('src') != 'none' && nextVideo[0].play(); })(); liArray.eq(that.curLiIndex).removeClass('cur ' + effectJson[types][effectKey][0]); liArray.eq(that.targetIndex).removeClass(effectJson[types][effectKey][1]); that.curLiIndex = that.targetIndex; that.autoPlay(); }, that.durationTime - 20); break; case 4: case 5: liArray.eq(that.curLiIndex).addClass(effectJson[types][effectKey][0]); setTimeout(function() { liArray.eq(that.curLiIndex).removeClass('cur ' + effectJson[types][effectKey][0]); liArray.eq(that.targetIndex).addClass('cur ' + effectJson[types][effectKey][1]); setTimeout(function() { (function() { var curVideo = liArray.eq(that.curLiIndex).find('video'), nextVideo = liArray.eq(that.targetIndex).find('video'); curVideo.length && curVideo.attr('src') != 'none' && curVideo[0].pause(); nextVideo.length && nextVideo.attr('src') != 'none' && nextVideo[0].play(); })(); liArray.eq(that.targetIndex).removeClass(effectJson[types][effectKey][1]); that.curLiIndex = that.targetIndex; that.autoPlay(); }, that.durationTime); }, that.durationTime - 20); break; } }; Banner3D.prototype.IEanimationFun = function(types) { var that = this, aKey = null, effectKey = that.effectKey, liArray = that.liArray, effectJson = that.effectJson; that.sidebarArea.length && that.sidebarArea.find('em').removeClass('cur').eq(that.targetIndex).addClass('cur'); that.smallpicObj.area.length && that.smallpicObj.area.find('em').removeClass('cur').eq(that.targetIndex).addClass('cur'); that.piclistArea.attr('class', (that.curDomType === 'rowGroup' ? 'rowGroup-box' : 'piclist-area') + ' bannerEffect-' + types); switch (types) { case 1: liArray.eq(that.curLiIndex).animate({ 'opacity': 0 }, that.durationTime, function() { $(this).removeClass('cur').css('opacity', ''); that.curLiIndex = that.targetIndex; that.autoPlay(); }); liArray.eq(that.targetIndex).addClass('cur').css('opacity', 0).animate({ 'opacity': 1 }, that.durationTime); break; case 2: aKey = that.effectKey == 1 ? ['-100%', '100%'] : ['100%', '-100%']; liArray.eq(that.curLiIndex).animate({ 'left': aKey[0] }, that.durationTime, function() { $(this).removeClass('cur').css('left', 0); that.curLiIndex = that.targetIndex; that.autoPlay(); }); liArray.eq(that.targetIndex).addClass('cur').css('left', aKey[1]).animate({ 'left': 0 }, that.durationTime); break; case 3: aKey = that.effectKey == 1 ? ['-100%', '100%'] : ['100%', '-100%']; liArray.eq(that.curLiIndex).animate({ 'top': aKey[0] }, that.durationTime, function() { $(this).removeClass('cur').css('top', 0); that.curLiIndex = that.targetIndex; that.autoPlay(); }); liArray.eq(that.targetIndex).addClass('cur').css('top', aKey[1]).animate({ 'top': 0 }, that.durationTime); break; } }; Banner3D.prototype.autoPlay = function() { var that = this; if (that.autoTime) { that.autoTimeFun = setTimeout(function() { that.effectKey = 1; that.initFun(that.curLiIndex + 1); // that.curLi = that.liArray.eq(that.curLiIndex + 1); }, that.autoTime); } }; $.extend({ banner3D: function(curDom) { curDom[0]['banner3D'] = new Banner3D(curDom); curDom[0].banner3D.init(); } }); })(jQuery); /* * jquery focusImg * 鐒︾偣鍥緅s鍔熻兘 */ (function ($) { $.fn.extend({ focusImg: function (options) { return this.each(function () { var Opts = { uistyle: "style-1", fnclass: "inOut", evtype: "mouseenter", usertime: 6 }; Opts = $.extend(Opts, options); var full = $(this), fWidth = full.parent().width(), fHeight = full.parent().height(), uistyle = Opts.uistyle, fnclass = Opts.fnclass, pUl = full.children("ul"), pLi = pUl.find("li"), bNav = $("
"), times = null, an = true, y = 0, change = function (e) { //鍥剧墖鍦板潃鏇存崲 var curli = e, bigpic = curli.attr("bigpic"), bcolor = curli.attr("bcolor"); curli.css({ "background-color": bcolor, "background-image": "url(" + bigpic + ")" }); curli.attr("change", "true"); }, eventfn = function (obj, fobj) { //浜嬩欢妯″紡 obj.find(fobj).each(function (e) { $(this).bind(Opts.evtype, function () { eval(fnclass + "(e)"); }); }); }; switch (Opts.fnclass) { case 'inOut': (function () { pUl.addClass('banner-pic-1').css({ "height": fHeight }); pLi.each(function () { $(this).css({ "height": fHeight }); }); })(); break; case 'LMove': (function () { full.css({ "height": fHeight + "px" }); pUl.addClass('banner-pic-2').css({ "width": pLi.length * fWidth + "px", "height": fHeight + "px" }); pLi.each(function () { $(this).css({ "width": fWidth + "px", "height": fHeight }); }); })(); break; case 'TMove': (function () { full.css({ "height": fHeight + "px" }); pUl.addClass('banner-pic-3').css({ "height": pLi.length * fHeight + "px" }); pLi.each(function () { $(this).css({ "height": fHeight }); }); })(); break; } switch (Opts.uistyle) { case "style-1": if (pLi.length > 1) { var ban = $(""); pLi.each(function (e) { ban.append(""); }); full.append(bNav.attr("class", "banner-nav-1").html(ban)); eventfn(ban, "span"); } break; case "style-2": if (pLi.length > 1) { var ban = $(""); pLi.each(function (e) { ban.append("" + (e + 1) + ""); }); full.append(bNav.attr("class", "banner-nav-2").html(ban)); eventfn(ban, "span"); } break; case "style-3": var ban = $(""); pLi.each(function () { var smallurl = $(this).attr("smallpic") ? $(this).attr("smallpic") : $(this).attr("bigpic"); var s = $("").html(""); ban.append(s); }); full.append(bNav.attr("class", "banner-nav-3").html(ban)); eventfn(ban, "span"); break; } var inOut = function (e) { var curli = pLi.eq(e); if (curli.attr("change") == "false") { change(curli); } var ospan = bNav.find("span.cur"); var o = ospan.index(); if (e != o) { if (an) { an = false; ospan.removeClass("cur"); bNav.find("span:eq(" + e + ")").addClass("cur"); pLi.eq(o).css({ "z-index": 3 }).animate({ "opacity": 0 }, 1000, function () { an = true; $(this).css({ "opacity": 1, "z-index": 1 }); }); curli.css({ "display": "block", "z-index": 2 }); y = y + 1; if (y >= pLi.length) { y = 0; } } } }; var LMove = function (e) { var fullW = full.parent().width(), fullH = full.parent().height(); var curli = pLi.eq(e); if (curli.attr("change") == "false") { change(curli); } var ospan = bNav.find("span.cur"); var o = ospan.index(); if (an) { an = false; ospan.removeClass("cur"); bNav.find("span:eq(" + e + ")").addClass("cur"); pUl.animate({ "left": "-" + e * fullW }, 200, function () { an = true; y = y + 1; if (y >= pLi.length) { y = 0; } }); } }; var TMove = function (e) { var fullH = full.height(); var curli = pLi.eq(e); if (curli.attr("change") == "false") { change(curli); } var ospan = bNav.find("span.cur"); var o = ospan.index(); if (an) { an = false; ospan.removeClass("cur"); bNav.find("span:eq(" + e + ")").addClass("cur"); pUl.animate({ "top": "-" + e * fullH }, 200, function () { an = true; y = y + 1; if (y >= pLi.length) { y = 0; } }); } }; times = setInterval(function () { eval(Opts.fnclass + "(y)"); }, (Opts.usertime) * 1000); full.mouseenter(function () { clearInterval(times); }); full.mouseleave(function () { times = setInterval(function () { eval(Opts.fnclass + "(y)"); }, (Opts.usertime) * 1000); }); eval(Opts.fnclass + "(y)"); }); } }); })(jQuery); /*鐢熸垚浜岀淮鐮佸緱鏂规硶*/ (function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d寰俊鎵竴鎵?/p>
' + j.text + '
'); j.html && that.tipDom.append(j.html); wsf.pDom.bodyDom.append(that.tipDom); that.tipDom.css({ display: 'block', opacity: 0, left: getOffset.left - (that.tipDom.outerWidth() - getWidth) / 2 + 'px' }); if(getOffset.top - $(document).scrollTop() > that.tipDom.outerHeight()){ top = getOffset.top - that.tipDom.outerHeight(); movetop = -30; that.tipDom.removeClass('bottom').addClass('top'); }else{ top = getOffset.top + getHeigght; movetop = 30; that.tipDom.removeClass('top').addClass('bottom'); } that.tipDom.css({ top: (top + movetop) + 'px' }).animate({ top: top + 'px', opacity: 1 }); } }, delTip: function(j){ var that = this; that.tipDom && that.tipDom.remove(); j.getDom.removeData('tip'); } }, upJsFun: function (curDom) { var getDom = null; switch(true){ case curDom.hasClass('customModule'): getDom = curDom.find('.MoBodyC > div'); break; case curDom.hasClass('ev-module-edit'): getDom = curDom.find('.ev-module-edit-box > div'); break; } if(getDom && getDom.length){ switch(true){ // newMo case getDom.hasClass('ev-pic'): case getDom.hasClass('ev-icon-pic'): wsf.f.imgLazyLoading(curDom); break; case getDom.hasClass('ev-banner-module'): wsf.banner3D.init(getDom); break; case getDom.hasClass('ev-albums-module'): wsf.textListModule(getDom); wsf.albums(getDom); wsf.f.imgLazyLoading(curDom); break; case getDom.hasClass('ev-search-module'): wsf.evSearch.load(getDom); break; // oldmo case getDom.hasClass('text-list-module'): setTimeout(function () { wsf.textListModule(getDom); wsf.moveModule(getDom); wsf.f.imgLazyLoading(curDom); }, 100); break; case getDom.hasClass('pic-text-module'): wsf.f.imgLazyLoading(curDom); break; case getDom.hasClass('focus-pic-module'): wsf.focusPicModule(curDom.find('.mo').attr('id')); break; case getDom.hasClass('pic-text-list-module'): setTimeout(function () { wsf.textListModule(getDom); wsf.moveModule(getDom); wsf.sysDoc(curDom.find('.ev-sys-doc-module')); wsf.f.imgLazyLoading(curDom); }, 100); break; case getDom.hasClass('form-module'): if(arguments[1]){ wsf.formModule.submit_verify(curDom.find('form'), arguments[1]); wsf.formModule.defaultValVerify(getDom); } break; case getDom.hasClass('video-module'): setTimeout(function () { wsf.videoModule(getDom); }, 100); break; case getDom.hasClass('catalogList'): setTimeout(function () { wsf.catalogList(getDom); }, 100); break; case getDom.hasClass('menu-catalog-module'): setTimeout(function () { wsf.menuCatalogModule(getDom); wsf.f.imgLazyLoading(curDom); }, 100); break; case getDom.hasClass('pic-module'): wsf.f.imgLazyLoading(curDom); break; } } }, annimationLoadMo: function (dom) { if (dom.attr('data-loadanimate') != 1) { dom.data('loadanimate', 1); var v = { 'dom': dom, 'st': dom.attr('style') || '', 'aName': dom.data('animate-name'), 'aDelay': dom.data('animate-delay'), 'aDuration': dom.data('animate-duration') }; if (v.aName) { v.dom.addClass('animated ' + v.aName).css({ 'animation-delay': v.aDelay, 'animation-duration': v.aDuration }); setTimeout(function () { v.dom.removeClass('load-animate'); }, v.aDelay.slice(0, v.aDelay.length - 1) * 1000 + 30); setTimeout(function () { v.dom.attr('style', v.st).removeClass('animated ' + v.aName); dom.hasClass('ev-module-edit-box') && wsf.f.progressLoading(dom); // 鍏充簬瑙嗛鐨勫姞杞 dom.hasClass('customModule') && (function(){ var videoModule = dom.find('div.video-module'); if(videoModule.length){ wsf.videoModule(videoModule); } })(); wsf.f.imgLazyLoading(v.dom); v.dom.find('.ev-module-edit-box,.customModule').each(function (i, dom) { dom = $(dom); dom.hasClass('ev-module-edit-box') && wsf.f.progressLoading(dom); // 鍏充簬瑙嗛鐨勫姞杞 dom.hasClass('customModule') && (function(){ var videoModule = dom.find('div.video-module'); if(videoModule.length){ wsf.videoModule(videoModule); } })(); wsf.f.annimationLoadMo(dom); }); }, v.aDelay.slice(0, v.aDelay.length - 1) * 1000 + v.aDuration.slice(0, v.aDuration.length - 1) * 1000 + 1); } } }, imgLazyLoading: function(curDom){ curDom.find('.lazy-loading').each(function(i, dom){ dom = $(dom); var oImage = new Image(); oImage.onload = function () { dom.attr('src', this.src).addClass('lazy-loading-animate'); setTimeout(function(){ dom.removeClass('lazy-loading lazy-loading-animate'); }, 1000); }; oImage.src = dom.attr('data-original-src'); }); }, progressLoading: function(curDom){ var progress = curDom.find('div.ev-progress-module'); progress.length && wsf.progress.load(progress.eq(0)); }, positionShow: function (curDom, pos) { // 璁$畻妯″潡鐨勪節涓綅缃 var domW = curDom.width(), domH = curDom.height(), posArray = [ [0, 'auto', 'auto', 0, 0, 0], [0, 'auto', 'auto', '50%', 0, '-' + domW/2 + 'px'], [0, 0, 'auto', 'auto', 0, '-' + domW], ['50%', 'auto', 'auto', 0, '-' + domH/2 + 'px', 0], ['50%', 'auto', 'auto', '50%', '-' + domH/2 + 'px', '-' + domW/2 + 'px'], ['50%', 0, 'auto', 'auto', '-' + domH/2 + 'px', 0], ['auto', 'auto', 0, 0, 0, 0], ['auto', 'auto', 0, '50%', 0, '-' + domW/2 + 'px'], ['auto', 0, 0, 'auto', 0, 0] ]; curDom.css({ 'top': posArray[pos][0], 'right': posArray[pos][1], 'bottom': posArray[pos][2], 'left': posArray[pos][3], 'margin-top': posArray[pos][4], 'margin-left': posArray[pos][5] }); }, mCScrollbar: function (obj, j) { if (!obj.data('cscroll')) { var j_ = { scrollInertia: 50, scrollbarPosition: 'outside', theme: "dark-3", autoHideScrollbar: false, mouseWheel: {preventDefault: true}, scrollButtons: { enable: false }, callbacks: { onScrollStart: function(){ }, onScroll: function(){ var $this = $(this); if(this.mcs.topPct === 100){ $.scrollify.next(); }else if(this.mcs.topPct === 0){ $.scrollify.previous(); } }, onTotalScroll: function(){ $.scrollify.next(); }, onTotalScrollBack:function(){ $.scrollify.previous(); } } }; if (j) { j_ = $.extend(j_, j); } obj.mCustomScrollbar(j_); obj.data('cscroll', 1); } else { obj.mCustomScrollbar("update"); } } }; //鍒嗕韩 wsf.share = { shareLayerDom :null, wechatCode : null, setwin: function (w, d) { var iWidth = w; //寮瑰嚭绐楀彛鐨勫搴? var iHeight = d; //寮瑰嚭绐楀彛鐨勯珮搴? var iTop = (window.screen.availHeight - 30 - iHeight) / 2; //鑾峰緱绐楀彛鐨勫瀭鐩翠綅缃? var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; //鑾峰緱绐楀彛鐨勬按骞充綅缃? return { iTop: iTop, iLeft: iLeft } }, openWindow: function(getData){ var that = this; window.open(getData.url, "newwindow", "width=" + getData.width + ",height=" + getData.height + ", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no,top=" + that.setwin(getData.width, getData.height).iTop + ",left=" + that.setwin(getData.width, getData.height).iLeft ); }, bindEvent: function(){ var that = this; wsf.pDom.bodyDom.on({ 'mouseenter.share': function(){ var $this = $(this); if($this.hasClass('evIcon')){ var type = $this.data('type'), data = $this.closest('.share-list').data(); switch (type) { case 'wechat': if(!$this.data('mouseenter')){ $this.data('mouseenter',1); var hostName = location.protocol + '//' + GData.wapDomain, geturl = (data.url && ((data.url).indexOf('vip_') != -1)) ? (data.url).replace(/vip_/, 'wap_') : data.url, div = $('鎵撳紑寰俊鎵竴鎵?/p>'); wsf.f.tip.addTip({getDom: $this.closest('li'), html: div}); } break; } } }, 'mouseleave.share': function(){ var $this = $(this); if($this.hasClass('evIcon')) { var type = $this.data('type'); switch (type) { case 'wechat': if($this.data('mouseenter')){ wsf.f.tip.delTip({getDom:$this.closest('li')}); $this.removeData('mouseenter'); } break; } } }, 'click.share': function(){ var $this = $(this); var type = $this.data('type'), data = $this.closest('.share-list').data(), url = encodeURIComponent(data.url ? (data.url.indexOf('http') != -1 ? data.url : (location.origin + data.url)) : location.href), title = encodeURIComponent(data.title || document.title), summary = encodeURIComponent(data.summary || $('meta[name="keywords"]').attr('content')), pic = encodeURIComponent(data.pic || ''); switch(type){ case 'weibo': that.openWindow({ url : 'http://service.weibo.com/share/share.php?url='+url+'&title='+title+'&count='+summary+'&pic='+pic+'&searchPic=true', width: 650, height: 534 }); break; case 'qzone': that.openWindow({ url : 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+url+'&title='+title+'&site='+url+'&summary='+summary+'&desc='+title+'&pics='+pic, width: 650, height: 534 }); break; case 'qq': that.openWindow({ url : 'http://connect.qq.com/widget/shareqq/index.html?url='+url+'&title='+title+'&site='+url+'&summary='+summary+'&desc='+title+'&pics='+pic, width: 800, height: 680 }); break; case 'douban': that.openWindow({ url : 'http://www.douban.com/recommend/?url='+url+'&title='+title+'&sel='+summary, width: 800, height: 680 }); break; case 'baidu': that.openWindow({ url : 'http://tieba.baidu.com/f/commit/share/openShareApi?url='+url+'&title='+title+'&desc='+summary+'&comment=&pic='+pic, width: 630, height: 640 }); break; } } }, '.share-list .evIcon'); }, createShareLayer : function(clickDom){ var that = this; that.body = $('body'); if(!that.body.data('sharelayer')){ var listArray = [ ['weibo-3', 'wechat-1', 'qq-9', 'qzone-1', 'baidu-3', 'douban-2'], [['寰崥', 'weibo'], ['寰俊', 'wechat'], ['QQ濂藉弸', 'qq'], ['QQ绌洪棿', 'qzone'], ['鐧惧害', 'baidu'], ['璞嗙摚', 'douban']] ],liArray = []; $.each(listArray[0], function(i, v){ var txtarr = listArray[1][i]; liArray.push('
寰俊鎵竴鎵紝娣诲姞瀹㈡湇