我有一个简单的 jquery 脚本,用于帮助 mydiv 在页面中向下流动。效果很好!但是,它溢出了我如何阻止它,这样它就不会溢出页脚?
html
<div id="follow">
<div class="summaryTotal">
<h3>Estimated Total </h3>
<h3 class="summary" data-price="0">$0</h3>
<span class="small">Read more about our pricing here.</span>
</div>
<div class="well">
<h3>Quote:</h3>
<ul id="selections"></ul>
</div>
<button type="submit" class="button-success">Book Now!</button>
<a href="{{ URL::to('book/services') }}" class="button-error">Start over</a>
<div class="seperator"></div>
</div>
<br />
<footer>blah vlah</footer>
jQuery
$(document).ready(function () {
var speed = 1000;
var current_top = parseInt( $('#follow').css('top') );
$(window).scroll( function () {
var top = $(window).scrollTop();
$('#follow').css('top', top + current_top);
});
});
CSS
#follow {
position: absolute;
right: 10px;
}