stickUp icon indicating copy to clipboard operation
stickUp copied to clipboard

Using this plugin with dynamic elements

Open patrickse opened this issue 10 years ago • 0 comments

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

patrickse avatar May 15 '14 08:05 patrickse