This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function scrollToFixedPos() { | |
// containter to fix to and element to scroll | |
const $refElToFixTo = $('.ref-el-to-fix-to'); | |
const $elToFix = $('.el-to-fix') | |
//$padding is 15% of window height to adapt the placement of the scrolling element | |
const $wHeight = $(window).innerHeight(); | |
const $padding = $wHeight * 15 / 100; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// move element following mouse move based on center of the screen | |
const $elToMove = $('.element'); | |
function mouseMoveAnim() { | |
let mouseFromCenterX = 0; | |
let mouseFromCenterY = 0; | |
let divMovX = 0; | |
let divMovY = 0; | |
let windowW = 0; |