'how javascript to jquery
const boxes = document.querySelectorAll('.box')
window.addEventListener('scroll', checkBoxes)
checkBoxes()
function checkBoxes() {
const triggerBottom = window.innerHeight / 5 * 4
boxes.forEach(box => {
const boxTop = box.getBoundingClientRect().top
if(boxTop < triggerBottom) {
box.classList.add('show')
} else {
box.classList.remove('show')
}
})
}
Solution 1:[1]
You must check jQuery API to understand what's going on here:
const boxes = $('.box')
$(document).on('scroll', checkBoxes)
checkBoxes()
function checkBoxes() {
const triggerBottom = window.innerHeight / 5 * 4
boxes.each(() => {
const boxTop = box.getBoundingClientRect().top
if(boxTop < triggerBottom) {
$(this).addClass('show')
} else {
$(this).removeClass('show')
}
})
References:
$ - selecting elementson() - adding eventseach() - each elementaddClass() - add classremoveClass() - remove class
Solution 2:[2]
got the solution, you just do the following steps
Go to
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc
Download the suitable '".whl"' file (Make sure you choose the correct whl file. For example: If you are using Python 3.10 on a 64-bit machine choose '''pyodbc-4.0.32-cp310-cp310-win_amd64.whl'''.)
run
pip install pyodbc-4.0.32-cp310-cp310-win_amd64.whl
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | NNL993 |
| Solution 2 | Gord Thompson |
