Показать сообщение отдельно
  #9 (permalink)  
Старый 27.03.2014, 16:49
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,102

Bravo,
предположим футер это ваш 6 блок ... можно вам поставить любой класс вместо .footer строка 32 -- этот же код можно использовать для любого блока.
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>demo</title>
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <style type='text/css'>
  body{padding:0px;margin:0px}
  *{margin:0}
  html,body{height:2000px}
  .wrapper{min-height:100%;height: auto !important;height:100%}
  .footer,.push{height:600px}
  .footer{background:#6495ED}


        #go{
            width: 100px;
            height: 100px;
            position: fixed;
            top: 300px;
            left: 50px;
            background: red;
            display: none;
        }

  </style>
<script type='text/javascript'>
$(function(){
var up = $("#go"),
    b = parseFloat(up.css("top")),
    h = up.height(),
    d = $(".footer").offset();
$(document)
    .scroll(function () {
        var a = $(this).scrollTop();
         300 < a && d.top > a + b + h ? up.show() : up.hide();

    });
});
</script>
</head>
<body>
<div id="go"></div>
<div class="wrapper">
<p>Your website content here.</p>
<div class="push"></div>
</div>
<div class="footer">
  <p>Copyright (c) 2013</p>
</div>
</body>
</html>
Ответить с цитированием