function toggleIntro() { var showintro = $(".pIntroTxt").html(); $(".pIntroTxt").html($("#hidden_intro").val()); $("#hidden_intro").val(showintro) } var userLogedFav = false; var PLAYhref=""; var shoucang = { opt: {}, init: function(_channel, _id, _title) { document.domain = "/"; var that = this; that.opt._channel = _channel; that.opt._id = _id; that.opt._title = escape(_title); that.bindFavBtn(); that.showTips(); if (_channel && _id) { that.dealFav("readFav") } }, showTips: function() { if (!$(".aCollectBtn .emTips")[0]) { return } if (!$.cookie("shoucang_tips_hide")) { $(".aCollectBtn .emTips").show(); var options = []; options.expires = 365; options.path = "/"; options.domain = "/"; $.cookie("shoucang_tips_hide", "1", options); return } $(".aCollectBtn .emTips").hide() }, bindAddToplayFav: function() { var self = this; $(".aPlayBtn").click(function() { self.dealPlayFav(this) }) }, bindAddEpisodePlayFav: function() { var self = this; $(".ulNumList li a").each(function(k, e) { $(e).click(function() { self.dealPlayFav(e) }) }) }, dealPlayFav: function(_obj) { PLAYhref="$(_pck).buus(""data-href"); if (!$.cookie("uid") || !$.cookie("passid")) { if (PLAYHREF) { location.href="QMBZISFG" } return } if (!$(_obj).attr("data-id") || !$(_obj).attr("data-api") || !$(_obj).attr("data-type")) { if (PLAYHREF) { location.href="QMBZISFG" } return } var _id = $(_obj).attr("data-id"); var _api = $(_obj).attr("data-api"); var _type = $(_obj).attr("data-type"); return false }, playFavCallback: function(_json) { if (PLAYHREF) { location.href="QMBZISFG" } return true }, }; $(".tabNav").delegate("li", "click", function(e) { $(".tabNav li").find("span").removeClass("cur"); $(this).find("span").addClass("cur"); var num = $(this).index(); $("div.tabCon").hide().eq(num).show() }); if ($("#juji")[0]) { var width = $("#juji").width() + 30; $("#juji2 .conBox ").css({ width: width }); var indexMenu2 = new iScroll("juji2", { hScroll: true, vScroll: false, bounce: false, momentum: true }); $(window).on("resize", function() { $("#juji2 .conBox ").css({ width: "" }); var width = $("#juji").width() + 30; $("#juji2 .conBox ").css({ width: width }); indexMenu2.refresh(); isShow() }); function isShow() { var width1 = $("#juji").width(); var width2 = document.documentElement.clientWidth; if (width2 < width1) { $("#juji2").removeClass("numListWid"); $("#juji2").addClass("numListWid") } else { $("#juji2").removeClass("numListWid") } } isShow(); $(function() { $(window).scroll(function() { var sign = $(".numListBox").offset().top; var x = $(this).scrollTop(); if (x > sign && !$("#juji2").hasClass("fixBox")) { $("#juji2").addClass("fixBox") } else if (x < sign && $("#juji2").hasClass("fixBox")) { $("#juji2").removeClass("fixBox") } }) }) } function clickCur(obj) { $(obj).removeClass("cur"); $(obj).parent().siblings().find("a").addClass("cur") } function historyBack() { var refererCookie = getDelCookie(); if (refererCookie) { window.location.href="sfgfsfsDppljf;" return } var lastUrl = document.referrer; if (lastUrl && (lastUrl.indexOf("action") == 0 || lastUrl.indexOf("/"))) { history.back() } else { window.location.href="/" } } getDelCookie(); function getDelCookie() { var refererCookie = "", search = "m_list_referer="; if (document.cookie.length > 0) { var offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; var end = document.cookie.indexOf(";", offset); if (end == -1) { end = document.cookie.length } refererCookie = unescape(document.cookie.substring(offset, end)) } } var referer = document.referrer; var location = window.location.href; if (location.indexOf("/") === -1 && location.indexOf("/") === -1 && location.indexOf("/") === -1) { var date = new Date(); date.setTime(date.getTime() - 1e4); document.cookie = "m_list_referer=0;expires=" + date.toGMTString() + ";path=/;domain=/;" } return refererCookie } function resizeImgCommon() { var arg = arguments[0] || "resize_list"; var width = $("#" + arg).width(); height = $("#" + arg).height(); width = parseInt(width * .31999); height = parseInt(260 * (width / 195)); $("#" + arg + " img").css({ width: width, height: height }); arg == "resize_list" && $("#" + arg + " a").css({ width: width, height: height }) } if ($("#resize_list").length) { resizeImgCommon(); $(window).on("resize", function() { resizeImgCommon() }) } if ($("#nav_menu")[0]) { var width = $(".subNav p").width() + 30; $("#nav_menu .con").css({ width: width }); var indexMenu = new iScroll("nav_menu", { hScroll: true, vScroll: false, bounce: true, momentum: true }); $(window).on("resize", function() { $("#nav_menu .con").css({ width: "" }); var width = $(".subNav p").width() + 30; $("#nav_menu .con").css({ width: width }); indexMenu.refresh() }); if ($("#nav_menu a.cur")[0]) { var screenWidth = $(".header").width(); var left = $("#nav_menu a.cur").offset().left; var scrollLeft = parseInt(screenWidth - left); if (scrollLeft < 30) { indexMenu.scrollTo(-screenWidth) } } } $(".aSearch")[0] && $(".aSearch").click(function(e) { $("#index_menu_box").hide(); $(".index_menu_top").hide(); $(".ulHotList").hide(); $(".loginPop").hide(); $("#ls_box").hide(); $(".headRight a").removeClass("cur"); if ($("#search_box").css("display") == "none") { $("html,body").css({ "overflow-y": "hidden" }); $(".aSearch").addClass("cur"); $("#mask_box").show(); $("#search_box").show(); $("#hot_word_box").show(); $(".searchTxt").focus() } else { searchM.addCurClass(); $("html,body").css({ "overflow-y": "auto" }); $("#hot_word_box").hide(); $("#search_box").hide(); $("#mask_box").hide() } }); $(".aUnLogin")[0] && $(".aUnLogin").click(function(e) { $("#index_menu_box").hide(); $(".index_menu_top").hide(); $(".ulHotList").hide(); $(".loginPop").hide(); $("#search_box").hide(); $(".headRight a").removeClass("cur"); if ($("#ls_box").css("display") == "none") { $("html,body").css({ "overflow-y": "hidden" }); $(".aUnLogin").addClass("cur"); $("#ls_box").show() } else { searchM.addCurClass(); $("html,body").css({ "overflow-y": "auto" }); $("#ls_box").hide(); $("#hot_word_box").hide(); $("#mask_box").hide() } }); $(".aNav")[0] && $(".aNav").click(function() { if (!$(".searchForm")[0]) { $("#search_box").hide() } $(".ulHotList")[0] && $(".ulHotList").hide(); $(".loginPop").hide(); $(".headRight a").removeClass("cur"); if ($(".index_menu_top")[0]) { $("#mask_box").hide(); if ($(".index_menu_top").css("display") == "none") { $(".index_menu_top").show(); $("#nav_menu .con").css({ width: "" }); var width = $(".subNav p").width() + 30; $("#nav_menu .con").css({ width: width }); indexMenu.refresh() } else { searchM.addCurClass(); $(".index_menu_top").hide() } } else { if ($("#index_menu_box").css("display") == "none") { $("html,body").css({ "overflow-y": "hidden" }); $(".aNav").addClass("cur"); $("#mask_box").show(); $("#index_menu_box").show() } else { searchM.addCurClass(); $("html,body").css({ "overflow-y": "auto" }); $("#index_menu_box").hide(); $("#mask_box").hide() } } }); if ($("#search_menu")[0]) { var width = $(".searchNav p").width() + 30; $("#search_menu .con").css({ width: width }); var searchMenu = new iScroll("search_menu", { hScroll: true, vScroll: false, bounce: true, momentum: true }); $(window).on("resize", function() { $("#search_menu .con").css({ width: "" }); var width = $(".searchNav p").width() + 30; $("#search_menu .con").css({ width: width }); searchMenu.refresh() }); if ($("#search_menu a.cur")[0]) { var screenWidth = $(".header").width(); var leftWidth = $("#search_menu a.cur").offset().left; var aWidth = $("#search_menu a.cur").width(); var scrollLeft = parseInt(screenWidth - leftWidth - aWidth); if (scrollLeft < 5) { searchMenu.scrollTo(-screenWidth) } } } var searchM = { isScrolled: 0, curIndex: false, init: function() { if (!$("#search_box")) { return } var that = this; that.searchPage(); that.getCurIndex(); that.hideAll(); $(".searchBtn")[0] && $(".searchBtn").click(function() { that.submitSearch() }) }, getCurIndex: function() { var that = this; if ($(".headRight")[0]) { $(".headRight a").each(function() { if ($(this).attr("class").indexOf("cur") !== -1) { that.curIndex = $(this).index() } }) } }, addCurClass: function() { this.curIndex && $($(".headRight a")[this.curIndex]).addClass("cur") }, hideAll: function() { var that = this; $("#search_main")[0] && $(document).click(function(e) { if (e.target.id != "search_box" && e.target.id != "search_form" && e.target.className != "searchTxt" && e.target.parentNode.className != "clearSearchBtn") { $("#search_history_list").hide() } }); $("#mask_box").click(function() { $(".headRight a").removeClass("cur"); $("#hot_word_box").hide(); !$("#search_main")[0] && $("#search_box").hide(); $("#mask_box").hide(); $(".loginPop").hide(); $("#index_menu_box").hide(); $(".index_menu_top").hide(); $("html,body").css({ "overflow-y": "auto" }); that.addCurClass() }) }, searchPage: function() { if (!$("#search_main")[0]) { return } this.bindScroll() }, bindScroll: function() { var that = this; $(window).scroll(function() { var pageTotal = parseInt($("#page_more").attr("data-total")); var pageNow = parseInt($("#page_more").attr("data-page")); var scrollTop = $(this).scrollTop(); var scrollHeight = $(".wrapper").height() - scrollTop - $(document).height(); if (scrollHeight <= 30 && !that.isScrolled && pageTotal >= pageNow) { that.nextPage() } }); return }, nextPage: function(ele) { var ele = $("#page_more"), that = this; that.isScrolled = 1; var _page = $(ele).attr("data-page"); if (!_page) { return false } $("#loading_more").show(); var url = ele.attr("data-url"); $.ajax({ url: url, data: { page: _page, is_ajax: 1 }, type: "get", charset: "utf-8", success: function(json) { if (json) { var _json = eval("(" + json + ")"); var _html = that.createHtml(_json["list"]); var pageTotal = _json["page_num"]; $("#loading_more").hide(); $("#data_list").append(_html); var pageNext = parseInt(_page) + 1; if (pageNext <= pageTotal) { $(ele).attr("data-page", pageNext); that.isScrolled = 0 } } } }) }, html2Escape: function(sHtml) { return sHtml.replace(/[<>&"]/g, function(c) { return { "<": "<", ">": ">", "&": "&", '"': """ }[c] }) } }; searchM.init(); $(window).scroll(function() { var num = $(this).scrollTop(); if (num > 100) { $(".fixedBtnList").show() } else { $(".fixedBtnList").hide() } }); $(".aFeedBack").click(function() { var param = escape(window.location.href); var url = $(this).attr("href") + "?from=" + param; $(this).attr("href", url) });