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
Post a Comment