if window width jquery then display a div at scroll
function updateContainer() {
$(window).scroll(function() {
if ( $(window).width() > 960 ) {
if( $(window).scrollTop() > 40 && $(document).height() - $(window).height() > 79 ) { // scroll bug appears if 78 or lower
add_desktop();
} else if ($(window).scrollTop() <= 40 ) {
remove_desktop();
}
} else {
if( $(window).scrollTop() > 40 && $(document).height() - $(window).height() > 160 ) {
add_mobile();
} else if ($(window).scrollTop() <= 40 ) {
remove_mobile();
//alert (winwidth);
}
}
});
}
Also in JavaScript:
- js dom ready function
- c# parse json
- placeholder text disappear when click in react
- /runtime.d7bbc2cdb230ca3d1157.js
- how to change text of div in javascript
- check if checkbox is checked jquery
- remove object from array by name javascript
- react memo
- The value associated with each key will be an array consisting of all the elements that resulted in that return value when passed into the callback.
- add class to body javascript
- nodejs connection to localhost refused mysql errno -61
- ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js): Error: ENOENT: no such file or directory, scandir
- javascript ellipsis
- take out decoration from link react
- angular 6 reload current page
- javascript filter array of objects
- space youtube
- javascript add option element to select
- javascript how to select a array
- how to add seconds to time in js
- regular expression number from 1 to 100
- npm check updates
- js json groupby prop
- substring javascript