Comments (6)
It seems to be because when vartop
is set, $(this)
refers to document and the purpose of .offset()
is to determine position relative to document, so it's always undefined. Is that accurate? It seems like vartop
could be replaced with 0
with no consequence to the plugin if so.
from stickup.
Same problem. Can yaou help me to replace vartop with 0 ?
from stickup.
Just come across this working on a site for a client and I'm wondering why this hasn't been dealt with and closed off yet. As @michaeldhopkins stated, replacing vartop
with 0
has no ill effects.
Is this project no longer maintained?
from stickup.
Just append var vartop = 0;
right after var topMargin = 0;
Here is peace of code where I append:
$(document).ready(function(){
var contentButton = [];
var contentTop = [];
var content = [];
var lastScrollTop = 0;
var scrollDir = '';
var itemClass = '';
var itemHover = '';
var menuSize = null;
var stickyHeight = 0;
var stickyMarginB = 0;
var currentMarginT = 0;
var topMargin = 0;
var vartop = 0; //Append default value here!
$(window).scroll(function(event){
from stickup.
@almask, yeah that's exactly what I did also. However, it would seem that vartop
is in fact superfluous to requirements and all logic relating to it could probably be removed entirely also.
Anyhow, it would be nice to see, at the very least, that change/patch be implemented so that people using the library don't see the error in their console!
from stickup.
Add
var vartop = 0;
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
- 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
- stickUp在jquery3.2.1下不工作,目标menu包含top属性 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.