30 lines
895 B
JavaScript
30 lines
895 B
JavaScript
$(function () {
|
|
var targetArray = ["/otn/", "otn/zzzcx/init", "/otn/leftTicket/init", "/otn/index/init", "/otn/login/init", "/otn/lcxxcx/init"];
|
|
var path = self.location.pathname;
|
|
if ($.inArray(path, targetArray) === -1)
|
|
return;
|
|
|
|
var lastDismiss = localStorage["dismiss_infobar"];
|
|
if (lastDismiss && new Date(parseInt(lastDismiss)).getDate() === new Date().getDate()) {
|
|
return;
|
|
}
|
|
|
|
$("body").prepend("<div class='new-lb-infobar'><a href='http://12306.liebao.cn/?f=12306' target='_blank'></a><button>关闭提示</button></div>");
|
|
$("body").addClass("header-lb");
|
|
|
|
var bar = $(".new-lb-infobar");
|
|
var dismiss = function () {
|
|
localStorage["dismiss_infobar"] = new Date().getTime();
|
|
$("body").removeClass("header-lb");
|
|
bar.hide();
|
|
};
|
|
|
|
bar.find("a").click(function () {
|
|
//TODO 添加埋点
|
|
});
|
|
|
|
bar.find("button").click(function () {
|
|
dismiss();
|
|
return false;
|
|
});
|
|
}); |