Идём в свой шаблон и переходим по пути: Шаблоны --> core --> front --> global --> globalTemplate
Ищем закрывающийся тег </head> и перед ним вставляем следующий скрипт:
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('body').append("<div class='scrolltotop'><div class='scrolltotop__side'></div><div class='scrolltotop__arrow'></div></div>");
jQuery(window).scroll(function(){
if (jQuery(this).scrollTop() > 350) {
jQuery('.scrolltotop').fadeIn();
} else {
jQuery('.scrolltotop').fadeOut();
}
});
jQuery('.scrolltotop').click(function(){
jQuery("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
});0
</script>
Далее переходим во вкладку CSS и в custom.css добавляем оформление для нашего скрипта:
.scrolltotop { display:none; position:fixed; width:3%; top:0; left:0; height:100% ;z-index:9000; cursor:pointer } .scrolltotop__side { position:fixed; width:3%; height:100%; top:0; left:0; background: black; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0.2); -moz-opacity:0.1; -khtml-opacity:0.1; opacity:0.1 } .scrolltotop__arrow { position:fixed; width:3%; height:100%; top:50px; left:0; background:url(http://путь_до_своей_кнопки/totop.png) top no-repeat; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0.4)"; filter:alpha(opacity=0.4); -moz-opacity:0.4; -khtml-opacity:0.4; opacity:0.4 }
Recommended Comments
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.