javascript - How to write this line in JS.? -


how write line in pure javascript , remove jquery stance $?

 $(window).bind("scroll", function() { 

here full function i'm using.

var tableoffset = $("#av-enrollment-table-header").offset().top;       var $header = $("#av-enrollment-table-header > thead").clone();       var $fixedheader = $("#header-fixed").append($header);        $(window).bind("scroll", function() {           var offset = $(this).scrolltop();            if (offset >= tableoffset && $fixedheader.is(":hidden")) {               $fixedheader.show();           }           else if (offset < tableoffset) {               $fixedheader.hide();           }       }); 

use javascript "scroll" event:

 window.addeventlistener("scroll", function() { 

see https://developer.mozilla.org/en-us/docs/web/events/scroll


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -