#1025 - Нужно добавить элемент прокрутки вверх (для длинных страниц)

parent d7be3b48
...@@ -128,4 +128,8 @@ FileUploadBundle::register($this); ...@@ -128,4 +128,8 @@ FileUploadBundle::register($this);
</div> </div>
</footer> </footer>
<div class="up-button-container">
<div class="up-button"></div>
</div>
<?php echo $this->render('block/callback'); ?> <?php echo $this->render('block/callback'); ?>
\ No newline at end of file
...@@ -14,4 +14,8 @@ ...@@ -14,4 +14,8 @@
</div> </div>
</div> </div>
</div> </div>
</footer> </footer>
\ No newline at end of file
<div class="up-button-container">
<div class="up-button"></div>
</div>
\ No newline at end of file
...@@ -31,4 +31,8 @@ ...@@ -31,4 +31,8 @@
</div> </div>
</footer> </footer>
<div class="up-button-container">
<div class="up-button"></div>
</div>
<?php echo $this->render('block/callback'); ?> <?php echo $this->render('block/callback'); ?>
\ No newline at end of file
...@@ -275,6 +275,28 @@ pre code { ...@@ -275,6 +275,28 @@ pre code {
.preview-image { .preview-image {
text-align: center; text-align: center;
} }
.up-button {
background: url(../images/up-button.png) no-repeat left top;
width: 56px;
height: 72px;
position: absolute;
left: -80px;
top: 0;
cursor: pointer;
display: none;
}
.up-button:hover {
background-position: right top;
}
.up-button-container {
position: fixed;
width: 970px;
height: 0px;
bottom: 150px;
left: 50%;
margin-left: -485px;
z-index: 2;
}
/* ------------ BLOG MODAL ------------------ */ /* ------------ BLOG MODAL ------------------ */
......
$(document).ready(function() { $(document).ready(function() {
$(window).scroll(function(){
if($(window).scrollTop() > 700)
{
$('.up-button').show();
}
else
{
$('.up-button').hide();
}
});
$('.up-button').click(function(){
$("html, body").animate({ scrollTop: 0 }, "slow");
});
$("a.toggle_bottom").click(function() { $("a.toggle_bottom").click(function() {
var a = $(this); var a = $(this);
$("html, body").animate({ scrollTop: $(a.attr('href')).position().top - 50 }, "slow"); $("html, body").animate({ scrollTop: $(a.attr('href')).position().top - 50 }, "slow");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment