Категория: Скрипты для uCoz Добавил: Гость » Дата: 28.05.2011
 


Кнопка скроллинга. При нажатии на нее сайт автоматически пролистывается вверх.


Установка:

Ставить перед тегом /body:
Code
<style type="text/css">  
  element.style {  
  display: inline;  
  }  
   
  #toTop {  
  background-attachment: scroll;  
  background-clip: border-box;  
  background-color: rgb(102, 102, 102);  
  background-image: url("http://isu-ucoz.3dn.ru/script/up.png");  
  background-origin: padding-box;  
  background-position: 50% 50%;  
  background-repeat: no-repeat;  
  background-size: auto;  
  border-bottom-left-radius: 5px;  
  border-bottom-right-radius: 5px;  
  border-top-left-radius: 5px;  
  border-top-right-radius: 5px;  
  bottom: 5px;  
  color: rgb(255, 255, 255);  
  cursor: pointer;  
  display: none;  
  height: 32px;  
  margin-bottom: 20px;  
  margin-left: 20px;  
  margin-right: 20px;  
  margin-top: 20px;  
  padding-bottom: 15px;  
  padding-left: 15px;  
  padding-right: 15px;  
  padding-top: 15px;  
  position: fixed;  
  right: 5px;  
  text-decoration: none;  
  width: 32px;  
  </style>  
   
  <a style="display: inline" id="toTop"/>  
  <script type="text/javascript">  
  <!--  
  $(function(){$.fn.scrollToTop=function(){$(this).hide().removeAttr
("href");if($(window).scrollTop()>="300"){$(this).fadeIn("slow")}var scrollDiv=$(this);$(window).scroll(function(){if($(window).scrollTop()<="300"){$(scrollDiv).fadeOut("slow")}else{$(scrollDiv).fadeIn("slow")}});$(this).click(function(){$("html, body").animate({scrollTop:0},"slow")})}});  
  $(function(){$("#toTop").scrollToTop();});  
  //-->  
  </script>
Просмотров: 292 | Комментариев: 0