// JavaScript Document /* * @description 民国连环画通用效果 * @author GuoR * @Date 2016/1/22 */ // JavaScript Document /* * @description 民国连环画通用效果 * @author GuoR * @Date 2016/1/22 */ var y_l_s = "B35E1BFA6B8C01D0BB26C0FF1273014F044D3DB9392CDC70"; window.szgx = window.szgx || {}; szgx.pageInfo = szgx.pageInfo || {}; szgx.pageInfo.responseInfo = { cnf: [] }; $(function () { Common.GetUrlValue(); $(".topZ ul li a").each(function () { $(this).attr("href", $(this).attr("href") + "?libcode=" + urlParams.libcode); }); var intervalIds = setInterval(function () { var windowp = $(window).scrollTop() + $(window).height(); //$("#ssssss").text(windowp); //if ("undefined" != typeof szgx) //{ // clearInterval(intervalIds); // return; //} //szgx | clearInterval(intervalIds); for (var index = 0; index < szgx.pageInfo.responseInfo.cnf.length; index++) { if (szgx.pageInfo.responseInfo.cnf[index].style == 0 && szgx.pageInfo.responseInfo.cnf[index].range.min <= windowp && szgx.pageInfo.responseInfo.cnf[index].range.max >= windowp) { var curidname = "#" + szgx.pageInfo.responseInfo.cnf[index].asyncmodle; szgx.pageInfo.responseInfo.cnf[index].style = 1; //加载数据 var indexx = index; $.get($(curidname).attr("data-block")).success(function (a) { if (a != null) { $(curidname).append(a); $(curidname).removeClass(szgx.pageInfo.responseInfo.loadingName); //日志的插入 if (szgx.pageInfo.responseInfo.cnf[indexx].log != undefined) { if (szgx.pageInfo.responseInfo.cnf[indexx].log != "") { Common.LogDictionary(szgx.pageInfo.responseInfo.cnf[indexx].log.split(',')[0], szgx.pageInfo.responseInfo.cnf[indexx].log.split(',')[1]); szgx.pageInfo.responseInfo.cnf[indexx].log = "" } } } }); //break; } else if (szgx.pageInfo.responseInfo.cnf[index].style == 2 && szgx.pageInfo.responseInfo.cnf[index].range.min <= windowp && szgx.pageInfo.responseInfo.cnf[index].range.max >= windowp) { szgx.pageInfo.responseInfo.cnf[index].style = 1; //给当前赋值 //szgx.pageInfo.responseInfo.curLayout = szgx.pageInfo.responseInfo.cnf[index].layout; //szgx.pageInfo.responseInfo.cnf[index].curLayout = szgx.pageInfo.responseInfo.cnf[index].layout; var a = szgx.pageInfo.responseInfo.cnf[index]; if (a.l_d == "") { a.l_d = szgx.pageInfo.responseInfo.loadingData; } var idname = "#" + szgx.pageInfo.responseInfo.cnf[index].asyncmodle; $(idname).hasClass(szgx.pageInfo.responseInfo.loadingName) || $(idname).addClass(szgx.pageInfo.responseInfo.loadingName); Getdata.GetBind(a); //break; } } var bools = true; for (var index = 0; index < szgx.pageInfo.responseInfo.cnf.length; index++) { if (szgx.pageInfo.responseInfo.cnf[index].style != 1) { bools = false; break; } } if (bools) { clearInterval(intervalIds); //alert("sss"); } }, 500); }); /*返回顶部*/ (function (t) { function e(t) { return t.replace(/(:|\.)/g, "\\$1") } var l = "1.4.13", o = {}, s = { exclude: [], excludeWithin: [], offset: 0, direction: "top", scrollElement: null, scrollTarget: null, beforeScroll: function () { }, afterScroll: function () { }, easing: "swing", speed: 400, autoCoefficent: 2, preventDefault: !0 }, n = function (e) { var l = [], o = !1, s = e.dir && "left" == e.dir ? "scrollLeft" : "scrollTop"; return this.each(function () { if (this != document && this != window) { var e = t(this); e[s]() > 0 ? l.push(this) : (e[s](1), o = e[s]() > 0, o && l.push(this), e[s](0)) } }), l.length || this.each(function () { "BODY" === this.nodeName && (l = [this]) }), "first" === e.el && l.length > 1 && (l = [l[0]]), l }; t.fn.extend({ scrollable: function (t) { var e = n.call(this, { dir: t }); return this.pushStack(e) }, firstScrollable: function (t) { var e = n.call(this, { el: "first", dir: t }); return this.pushStack(e) }, smoothScroll: function (l, o) { if (l = l || {}, "options" === l) return o ? this.each(function () { var e = t(this), l = t.extend(e.data("ssOpts") || {}, o); t(this).data("ssOpts", l) }) : this.first().data("ssOpts"); var s = t.extend({}, t.fn.smoothScroll.defaults, l), n = t.smoothScroll.filterPath(location.pathname); return this.unbind("click.smoothscroll").bind("click.smoothscroll", function (l) { var o = this, r = t(this), i = t.extend({}, s, r.data("ssOpts") || {}), c = s.exclude, a = i.excludeWithin, f = 0, h = 0, u = !0, d = {}, p = location.hostname === o.hostname || !o.hostname, m = i.scrollTarget || (t.smoothScroll.filterPath(o.pathname) || n) === n, S = e(o.hash); if (i.scrollTarget || p && m && S) { for (; u && c.length > f;) r.is(e(c[f++])) && (u = !1); for (; u && a.length > h;) r.closest(a[h++]).length && (u = !1) } else u = !1; u && (i.preventDefault && l.preventDefault(), t.extend(d, i, { scrollTarget: i.scrollTarget || S, link: o }), t.smoothScroll(d)) }), this } }), t.smoothScroll = function (e, l) { if ("options" === e && "object" == typeof l) return t.extend(o, l); var s, n, r, i, c = 0, a = "offset", f = "scrollTop", h = {}, u = {}; "number" == typeof e ? (s = t.extend({ link: null }, t.fn.smoothScroll.defaults, o), r = e) : (s = t.extend({ link: null }, t.fn.smoothScroll.defaults, e || {}, o), s.scrollElement && (a = "position", "static" == s.scrollElement.css("position") && s.scrollElement.css("position", "relative"))), f = "left" == s.direction ? "scrollLeft" : f, s.scrollElement ? (n = s.scrollElement, /^(?:HTML|BODY)$/.test(n[0].nodeName) || (c = n[f]())) : n = t("html, body").firstScrollable(s.direction), s.beforeScroll.call(n, s), r = "number" == typeof e ? e : l || t(s.scrollTarget)[a]() && t(s.scrollTarget)[a]()[s.direction] || 0, h[f] = r + c + s.offset, i = s.speed, "auto" === i && (i = h[f] || n.scrollTop(), i /= s.autoCoefficent), u = { duration: i, easing: s.easing, complete: function () { s.afterScroll.call(s.link, s) } }, s.step && (u.step = s.step), n.length ? n.stop().animate(h, u) : s.afterScroll.call(s.link, s) }, t.smoothScroll.version = l, t.smoothScroll.filterPath = function (t) { return t.replace(/^\//, "").replace(/(?:index|default).[a-zA-Z]{3,4}$/, "").replace(/\/$/, "") }, t.fn.smoothScroll.defaults = s })(jQuery); /*显示*/ function xianshi() { document.getElementById('tanchu').style.cssText = "display:block;" if ($.browser.msie) { gaodu = $(window).height() + 'px'; kuandu = $(window).width() + 'px'; margintop = ($(window).height() - 609) / 2 + 'px'; } else { gaodu = window.innerHeight + 'px'; kuandu = window.innerWidth + 'px'; margintop = (window.innerHeight - 609) / 2 + 'px'; } document.getElementById('tanchu').style.cssText = "height:" + gaodu + ";width:" + kuandu + ";" document.getElementById('tanchuM').style.cssText = "margin-top:" + margintop + ";" } /*隐藏*/ function yincang() { document.getElementById('tanchu').style.cssText = "display:none;" }