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

Using this plugin with dynamic elements #26

Open
patrickse opened this issue May 15, 2014 · 0 comments
Open

Using this plugin with dynamic elements #26

patrickse opened this issue May 15, 2014 · 0 comments

Comments

@patrickse
Copy link

I have a problem with the vartop variable. It´s actually used as soon as I load the plugin and gets bound to the scroll event. I call the stickUp function from ajax callback because I am using the sticky feature for a progress bar.

Bacause the scroll event is bound and the vartop is not defined it will throw some errors on javascript console.

My workaround is, initialize vartop during the load of your plugin. Then there´s no error and the value gets a real value as soon as I call the stickUp function.

var stickyMarginB = 0;
        var currentMarginT = 0;
        var topMargin = 0;
        var vartop = 0;
        $(window).scroll(function(event){
            var st = $(this).scrollTop();
            if (st > lastScrollTop){
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

1 participant