mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
Added a virtual test
This commit is contained in:
parent
39d7861f34
commit
d328c911cb
7
js/dist/scrollspy.js
vendored
7
js/dist/scrollspy.js
vendored
@ -182,10 +182,14 @@ var ScrollSpy = function ($) {
|
||||
return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
|
||||
};
|
||||
|
||||
ScrollSpy.prototype._getOffsetHeight = function _getOffsetHeight() {
|
||||
return this._scrollElement === window ? window.innerHeight : this._scrollElement.offsetHeight;
|
||||
};
|
||||
|
||||
ScrollSpy.prototype._process = function _process() {
|
||||
var scrollTop = this._getScrollTop() + this._config.offset;
|
||||
var scrollHeight = this._getScrollHeight();
|
||||
var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight;
|
||||
var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
|
||||
|
||||
if (this._scrollHeight !== scrollHeight) {
|
||||
this.refresh();
|
||||
@ -197,6 +201,7 @@ var ScrollSpy = function ($) {
|
||||
if (this._activeTarget !== target) {
|
||||
this._activate(target);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._activeTarget && scrollTop < this._offsets[0]) {
|
||||
|
2
js/dist/scrollspy.js.map
vendored
2
js/dist/scrollspy.js.map
vendored
File diff suppressed because one or more lines are too long
@ -13,7 +13,7 @@
|
||||
<body data-spy="scroll" data-target=".navbar" data-offset="70">
|
||||
<div class="container">
|
||||
<nav class="navbar navbar-fixed-top navbar-dark bg-inverse">
|
||||
<a class="navbar-brand" href="#">Navbar</a>
|
||||
<a class="navbar-brand" href="#">Scrollspy test</a>
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#fat">@fat</a>
|
||||
@ -30,6 +30,9 @@
|
||||
<a class="dropdown-item" href="#three">three</a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#final">Final</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
@ -76,6 +79,9 @@
|
||||
<p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>
|
||||
<p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>
|
||||
<p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>
|
||||
<hr>
|
||||
<h2 id="final">Final section</h2>
|
||||
<p>Ad leggings keytar, brunch id art party dolor labore.</p>
|
||||
</div>
|
||||
|
||||
<script src="../vendor/jquery.min.js"></script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user