Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.

Seeing this error Uncaught ReferenceError: vartop is not defined #43

Open
studioleland opened this issue Mar 26, 2015 · 6 comments
Open

Comments

@studioleland
Copy link

Please assist.

@michaeldhopkins
Copy link

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.

@Marrieukr
Copy link

Same problem. Can yaou help me to replace vartop with 0 ?

@auralon
Copy link

auralon commented Feb 20, 2017

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?

@kunapyanov
Copy link

kunapyanov commented Feb 22, 2017

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){

@auralon
Copy link

auralon commented Feb 22, 2017

@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!

@eldadna
Copy link

eldadna commented Jun 4, 2017

Add
var vartop = 0;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants