ript> function Toast(msg, duration, type){ type = type || "default"; duration=isNaN(duration)?3000:duration; var m = document.createElement('div'); m.innerHTML = msg; if (type === "success") { m.style.cssText="max-width:60%;min-width: 150px;padding:0 14px;height: 40px;color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(92,184,92,1);font-size: 16px;"; } else if (type === "error") { m.style.cssText="max-width:60%;min-width: 150px;padding:0 14px;height: 40px;color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(217,83,79,1);font-size: 16px;"; } else { m.style.cssText="max-width:60%;min-width: 150px;padding:0 14px;height: 40px;color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.7);font-size: 16px;"; } document.body.appendChild(m); setTimeout(function() { var d = 0.5; m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in'; m.style.opacity = '0'; setTimeout(function() { document.body.removeChild(m) }, d * 1000); }, duration); } $(function () { $(".sub_true").on('mouseover', function () { $(".my_gcw").show(); $(".sub_true").attr("class", "sub_true_on"); }); $(".sub_true").on('mouseout', function () { $(".my_gcw").hide(); $(".sub_true_on").attr("class", "sub_true"); }) $('#search-btn').on('click', function () { var title = $("input[name='header_search_title']").val(); window.location.href = "/Index/News/search_list.html" + "?news_title=" + title; }) $("input[name='header_search_title']").on('keypress', function (event) { if (event.keyCode === 13) { var title = $("input[name='header_search_title']").val(); window.location.href = "/Index/News/search_list.html" + "?news_title=" + title; } }) })