Register    Sign in
Authentification
uCoz Scripts » Others » –

News in top page

News at the top of your page.
In Site Pages add :
Code

<div id="site-news-panel"><div id="site-news-cont-img"></div><div id="site-news-cont">More uCoz scripts at - "themes.ucoz.net" visit us and you won't regret!</div><a href="#" onclick="showHide();" id="site-news-cont-close"></a></div>  


In CSS add :
Code

#site-news-panel {background:#507c96;width:100%;min-height:30px;color:#fff;box-shadow: 0 4px 10px #444;positon:absolute !important;}  
#site-news-cont {padding: 7px 0px 7px 5px;text-align:left;float:left;}  
#site-news-cont-img {background: url(http://themes.ucoz.net/resources/images/b.png) no-repeat -17px 0px;width:11px;height:9px;float:left;margin: 5px 0px 0px 7px;}  
#site-news-cont-close {background: url(http://themes.ucoz.net/resources/images/b.png) no-repeat;width:16px;height:18px;float:right;margin: 6px 10px 0px 0px;display:block}  


In Site Pages add :
Code

<script type="text/javascript">  
  var elementId = 'site-news-panel';  
  function setCk (a,b,c) {  
  if (a) {  
  var date = new Date();  
  date.setTime(date.getTime() + (c * 24 * 60 * 60 * 1000));  
  document.cookie = a + '=' + escape(b) + '; expires="' + (date.toGMTString()) + '"; path="/"';  
  }  
  else  
  return null;  
  }  
   
  function getCk(a) {  
  var name = a + "=";  
  var ca = document.cookie.split(';');  
  for (var i = 0; i < ca.length; i++) {  
  var c = ca[i];  
  while (c.charAt(0) == ' ') c = c.substring(1, c.length);  
  if (c.indexOf(name) == 0) return c.substring(name.length, c.length);  
  }  
  return null;  
  }  
  function showHide () {  
  if (document.getElementById(elementId).style.display == '') {  
  document.getElementById(elementId).style.display = 'none';  
  setCk(elementId, 1, 1);  
  } else {  
  document.getElementById(elementId).style.display = '';  
  setCk(elementId, 0, 1);  
  }  
  }  
  if (getCk(elementId) == 1) {  
  document.getElementById(elementId).style.display = 'none';  
  }  
  </script>  






Autor: cioLAN  2017-11-22, 18:16:38   Views : 731   

Tags: news section, NEWS


Total comments (0)
avatar