$(function () { var search_input = $("#header .search_box_out .search_box .txt"); var thisValue = search_input.val(); search_input.focus(function () { if ($(this).val() == thisValue) { $(this).val("").css("color", "#000") } }).blur(function () { if ($.trim($(this).val()) == "" || $.trim($(this).val()) == null) { $(this).val(thisValue).css("color", "#999") } }) }); $(function () { if ($.browser.msie) { if ($.browser.version == 6.0) { var $btn = $("#vote .t_vote .btn,#message .t_msg .btn"); $btn.hover(function () { $(this).css("background-position", "0 -28px") }, function () { $(this).css("background-position", "0 0") }) } } }); $(function () { var $li_font = $("#sub_content_inner .sub_article_info li.font"); var $content = $("#sub_content_inner .article_des").find("p,span,font").andSelf(); $content.css({ "font-size": "14px", 'line-height': '2em', 'letter-spacing': '2px' }); $li_font.each(function (i) { if ($.browser.version == 6.0) { $(this).hover(function () { $(this).css({ "text-decoration": "underline", "color": "#81003d" }) }, function () { $(this).css({ "text-decoration": "none", "color": "#af0053" }) }) }; $(this).click(function () { var size = (12 + i * 2) + "px"; $content.css("font-size", size) }) }) }); $(window).load(function () { var windowWidth; var $top = $(".back_top"); function right() { windowWidth = $(window).width(); windowWidth = (windowWidth - 1003) / 2 - 19; $top.css("right", windowWidth + "px") }; right(); $(window).resize(function () { right() }); var scroll_top = $(window).scrollTop(); if (scroll_top >= 100) { $top.css('display', 'block') } else { $top.css('display', 'none') }; $(window).scroll(function () { scroll_top = $(this).scrollTop(); if (scroll_top >= 100) { $top.css('display', 'block') } else { $top.css('display', 'none') } }); $(".back_top").click(function () { $(window).scrollTop(0); $(".back_top").css('display', 'none') }) }); $(function () { var $rank = $(".ranking_list .content .list"); $rank.each(function () { $(this).find("li>span").each(function (i) { $(this).text(i + 1) }); $(this).find("li:eq(0)").css("background-position", "0 -48px"); $(this).find("li:eq(1)").css("background-position", "0 -72px"); $(this).find("li:eq(2)").css("background-position", "0 -96px") }) }); ; (function ($) { $.fn.extend({ "getString": function (len) { $(this).each(function (index) { var thisText = $(this).text(); thisText = $.trim(thisText); if (thisText.length > len) { $(this).text(thisText.substring(0, len) + "...") } }); return this } }) })(jQuery); $(function () { }); $(function () { var $aHref = $("a", "#latest_article_box h1.article_title"); var href = $aHref.attr("href"); $("#latest_article_box .des").getString(90).append("<a href=" + href + " style='color:#f11290;'>查看详情&gt;&gt;</a>"); $("#latest_article_box .article_list li:first").css({ "border-top": "1px dashed #e971ac", "padding-top": "5px" }).find("span").css("top", "5px") }); $(function () { var $li = $("li", "#hot_recommend .hot_list"); var href = ""; $li.each(function (i) { href = $(this).find("h3.title>a").attr("href"); $(this).find("p.des").getString(45).append("<a href=" + href + " style='color:#f11290;'>[查看详情]</a>"); $li.eq(2).css("border-bottom", "none") }) }); $(function () { var $part = $(".index_module_part"); $part.each(function () { var $odd = $(this).children(".index_list_module:odd"); $odd.css("float", "right") }); var $des = $(".index_list_module .hot_news_box .des"); $des.each(function () { var myHtml = $(this).children(".view").detach(); var thisText = $(this).text(); thisText = $.trim(thisText); if (thisText.length > 45) { $(this).text(thisText.substring(0, 45) + "...") }; $(this).append(myHtml) }) });
