', okValue: '确定', ok: function () { $.post("/callme.html", {tel:$("#tel").val()}, function (result) {alert(result.msg);}, "json"); return false; } }); d.showModal(); }); }); $(".search").bind("click", function () { $("#search-over").fadeIn(50); $("#search-warmp").show(); $("html,body").animate({scrollTop:0}, 200); searchBtn(); $("#search-tab .search-tab-hd li").each(function (i) {$(this).click(function(){$(this).addClass("on").siblings().removeClass("on");$("#search-tab .search-tab-con").eq(i).show().siblings().hide();}) }); $("#search-over").bind("touchmove", function (e){e.preventDefault()}, false); }); $("#search-clear").bind("click", function () { $("#search-button").text("取消"); $("#search-button").removeClass("search-go").addClass("search-cancel"); $("#keywords").val(""); $(this).hide(); }); $("#keywords").bind("keyup input keywords", function () { searchBtn(); }); $("#search-button").bind("click", function () { if ($(this).hasClass("search-go")) { searchGo(); } else { searchCancle(); } }); $("#history .search-change").click(function () { clearCookie('history'); getHistory("history", $("#history p")); }); function searchBtn() { if ($("#keywords").val() == "") { $("#search-clear").hide(); $("#search-button").text("取消"); $("#search-button").removeClass("search-go"); } else { $("#search-clear").show(); $("#search-button").text("搜索"); $("#search-button").addClass("search-go"); } } function searchCancle() { $("#search-over").fadeOut(50); $("#search-warmp").hide(); } function searchGo() { setHistory("history", $("#keywords").val()); getHistory("history", $("#history p")); var k = $("#keywords").val(); var url = "/seach/index.html?keyword=" + k; window.location = url; } getHistory("history", $("#history p"));