Comments (1)
jquery3.2.1 弃用size() 改用length. 插件中需要修改。
如果目标导航有top样式。只需要对top进行较。
下面修改最终实现在我想要的效果。如有更好方法请指教
var itemTop = 0;
itemTop = options.itemTop;
if (varscroll > itemTop) {
$(".stuckMenu").addClass("isStuck");
$(".stuckMenu").next().closest("div").css({
"margin-top": stickyHeight + stickyMarginB + currentMarginT + "px"
}, 10);
$(".stuckMenu").css("position", "fixed");
$(".isStuck").css({
"top": "0px"
}, 10, function () { });
};
if (varscroll < itemTop) {
$(".stuckMenu").removeClass("isStuck");
$(".stuckMenu").next().closest("div").css({
"margin-top": currentMarginT + "px"
}, 10);
$(".stuckMenu").css({
"top": itemTop + "px",
"position": "absolute"
}, 10, function () {
});
};
from stickup.
Related Issues (20)
- error in documentation
- Multiple stickUp elements
- Hello, can I release multiple Stickup on the basis of Stickup ?
- When using stickUp,a div which is behind the div that stickUped to will be added a margin-top style,causing a error in css
- Using this plugin with dynamic elements
- navbar not visible when navigated directly to a part of page
- isStuck is not removed HOT 4
- Stuck Element jumping from its container HOT 1
- vartop is undefined HOT 4
- Trigger events [enhancement]
- Two things to add... read this
- Seeing this error Uncaught ReferenceError: vartop is not defined HOT 6
- Uncaught TypeError
- stickUp2 released
- how stop fixed element at a certain point? HOT 5
- if `div.stuckMenu` next element is empty,`currentMarginT` is `NaN`
- Error jquery is not defined HOT 1
- deactivate on mobile devices
- 最后一个导航对应的区域的高度不足一屏,无法选中的bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stickup.