Files
DzzOffice/core/template/default/common/commer_header.htm
2024-07-25 17:14:54 +08:00

56 lines
2.2 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<header class="fixed-top lyear-layout-header">
<nav class="navbar sticky-top navbar-dark navbar-expand-lg navbar-light">
<div class="container-fluid d-flex justify-content-between">
<div class="text-truncate navbar-brand">
<!--{template header_left}-->
</div>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarScroll" aria-controls="navbarScroll" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarScroll">
<!--{template header_search}-->
<!--{template header_right}-->
</div>
</div>
</nav>
</header>
<script type="text/javascript">
jQuery(document).ready(function(e) {
_header.init('{FORMHASH}');//初始化头部效果
_notice.getNotificationCount();
});
_notice={};
_notice.flashStep=1;
_notice.checkurl='index.php?mod=system&op=notification&filter=checknew';
_notice.normalTitle= document.title;
_notice.getNotificationCount=function(){
jQuery.getJSON(_notice.checkurl,function(json){
var sum=parseInt(json.sum);
_notice.showTips(sum);
if(json.timeout>0) window.setTimeout(_notice.getNotificationCount,json.timeout);
});
}
_notice.showTips=function(sum){
if(sum>0){
jQuery('#dzz_notification>span.badge').html(sum).removeClass('hide');
_notice.flashTitle();
}else{
jQuery('#dzz_notification>span.badge').addClass('hide');
_notice.flashTitle(1);
}
}
_notice.flashTitle=function(flag){
//仅窗口不在焦点时闪烁title回到焦点时停止闪烁并将title恢复正常
if(flag || CurrentActive){//当前处于焦点
document.title=_notice.normalTitle;
_notice.flashTitleRun = false;
return;//退出循环
}
_notice.flashTitleRun = true;
_notice.flashStep++;
if (_notice.flashStep==3) {_notice.flashStep=1;}
if (_notice.flashStep==1) {document.title="【您有新的通知】";}
if (_notice.flashStep==2) {document.title="【$_G[setting][sitename]】";}
setTimeout(function(){_notice.flashTitle();},500); //循环
}
</script>