g2(html); }); } }); $(".readover a,.download").click(function () { if ('1' == '0') { paydown(); } else { $.get("pay.doc.downpay.10027319-1-1", function (html) { Dialog2(html); }); } }); if (window.location.hash === "#readpay") { payread(); } if (window.location.hash === "#downpay") { paydown(); } var login_ok; function payread() { $.get("doc/payread/10027319/", function (data) { if (data > 0) { preview = hcount; createpage(psize); } else if (data == -11) { login_ok = function () { payread(); } login_f(); } else if (data == -13) { Message("您没有阅读权限。", "提示"); } else if (data == -14) { Message("今天阅读次数已超,请明天再来下载。", "提示"); } else if (data == -1) { Dialog("积分不足,去充值?", "提示", function () { location = "/center/glodpay.html"; }); } else if (data == -12) { Message("文档不存在。", "提示"); } else { //出错了 } }); } function paydown() { $.post("down.doc.10027319.html", function (data) { if (data > 0) { location.href = "/down.doc.10027319.html"; } else if (data == -11) { login_ok = function () { paydown(); } login_f(); } else if (data == -13) { Message("您没有下载权限。", "提示"); } else if (data == -14) { Message("今天下载数量已超,请明天再来下载。", "提示"); } else if (data == -1) { Dialog("积分不足,去充值?", "提示", function () { location = "/center/glodpay.html"; }); } else if (data == -12) { Message("文档不存在。", "提示"); } else { //出错了 } }); } $(".view_toolbar .prev").click(function () { if (pcurrent > 1) { pcurrent--; gopage(); } }); $(".view_toolbar .next").click(function () { if (pcurrent < preview) { pcurrent++; gopage(); } }); $(".view_toolbar .cpage").change(function () { var p = parseInt($(this).val()); if (isNaN(p)) { // do nothing } else if (p < 1) { pcurrent = 1; } else if (p > preview) { pcurrent = preview; } else { pcurrent = p; } gopage(); }); function gopage() { if (pcurrent > pshow) { createpage(pcurrent - pshow + 5); } location.hash = "p" + pcurrent; } function getdocheight() { return $("#p1").height(); } $(window).scroll(function () { var top = $(window).scrollTop(); var fix = $(".view_body").offset().top; var advdoc = (getdocheight() + 126) * Number('2'); if (top - fix < advdoc) { var pcu = (top - fix) / (getdocheight() + 126); } else { var pcu = (top - fix - advdoc) / (getdocheight() + 12) + Number('2'); } pcurrent = Math.round(pcu) + 1; if (pcurrent > pshow) pcurrent = pshow; if (pcurrent < 1) { pcurrent = 1; } $(".view_toolbar .cpage").val(pcurrent); }); var doc_width = 900; $(".view_toolbar .small").click(function () { if (doc_width > 700) { doc_width -= 100; Scale(); } }); $(".view_toolbar .large").click(function () { if (doc_width < 1200) { doc_width += 100; Scale(); } }); $(".view_toolbar .full").click(function () { if (doc_width >= 1200) { doc_width = 900; } else { doc_width = 1200; } Scale(); }); function Scale() { $(".view_left").css({ "width": doc_width }); if (doc_width > 900) { $(".view_right").hide(); } else { $(".view_right").show(); } } context.init({ preventDoubleContext: false }); context.settings({ compress: true }); context.attach('.view_body img', [{ text: '上一页', action: function (e) { e.preventDefault(); $(".view_toolbar .prev").trigger("click"); } }, { text: '下一页', action: function (e) { e.preventDefault(); $(".view_toolbar .next").trigger("click"); } }, { text: '下载', action: function (e) { e.preventDefault(); $(".readover a,.download").trigger("click"); } }, { text: '刷新', action: function (e) { e.preventDefault(); location.reload(); } }, { text: '后退', action: function (e) { e.preventDefault(); window.history.go(-1); } } ]); $(document).on('mouseover', '.me-codesta', function () { $('.finale h1:first').css({ opacity: 0 }); $('.finale h1:last').css({ opacity: 1 }); }); $(document).on('mouseout', '.me-codesta', function () { $('.finale h1:last').css({ opacity: 0 }); $('.finale h1:first').css({ opacity: 1 }); }); $(".view_shang > span").click(function () { if ($(".view_shang > div").css("display") == "none") $(".view_shang > div").css("display", "inline-block"); else $(".view_shang > div").css("display", "none"); }); $('.edui-upload-video').bind('contextmenu', function () { return false; });