2013-06-25 08:47:56 +03:00
|
|
|
'use strict';
|
|
|
|
define(
|
|
|
|
[
|
|
|
|
'bootstrap'
|
|
|
|
], function () {
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
2013-06-25 09:27:09 +03:00
|
|
|
var _window = $(window);
|
|
|
|
var _scrollButton = $('#scroll-up');
|
|
|
|
|
2013-06-25 08:47:56 +03:00
|
|
|
$(window).scroll(function () {
|
2013-06-25 09:27:09 +03:00
|
|
|
if (_window.scrollTop() > 100) {
|
|
|
|
_scrollButton.fadeIn();
|
2013-06-25 08:47:56 +03:00
|
|
|
}
|
|
|
|
else {
|
2013-06-25 09:27:09 +03:00
|
|
|
_scrollButton.fadeOut();
|
2013-06-25 08:47:56 +03:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2013-06-25 09:27:09 +03:00
|
|
|
_scrollButton.click(function () {
|
2013-06-25 08:47:56 +03:00
|
|
|
$("html, body").animate({ scrollTop: 0 }, 600);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|