| Server IP : 216.106.184.20 / Your IP : 216.73.216.234 Web Server : LiteSpeed System : Linux asmodeus.in-hell.com 5.14.0-570.58.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 29 06:24:11 EDT 2025 x86_64 User : sekoaid1 ( 1891) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/sekoaid1/spp.raudhatulfalah.sch.id/js/ |
Upload File : |
/*
Mouse Parallax
==============
A simple jQuery plugin to allow given elements to be used as backgrounds that respond to mouse movement. Could easily be further extended or modified.
--------------
Author: "Pip Beard Design," Benjamin Alan Robinson
LICENSE: The MIT License (MIT)
*/
(function ( $ ) {
$.fn.extend({
mouseParallax: function(options) {
var defaults = { moveFactor: 5, zIndexValue: "-1", targetContainer: 'body' };
var options = $.extend(defaults, options);
return this.each(function() {
var o = options;
var background = $(this);
$(o.targetContainer).on('mousemove', function(e){
mouseX = e.pageX;
mouseY = e.pageY;
windowWidth = $(window).width();
windowHeight = $(window).height();
percentX = ((mouseX/windowWidth)*o.moveFactor) - (o.moveFactor/2);
percentY = ((mouseY/windowHeight)*o.moveFactor) - (o.moveFactor/2);
leftString = (0-percentX-o.moveFactor)+"%";
rightString = (0-percentX-o.moveFactor)+"%";
topString = (0-percentY-o.moveFactor)+"%";
bottomString = (0-percentY-o.moveFactor)+"%";
background[0].style.left = leftString;
background[0].style.right = rightString;
background[0].style.top = topString;
background[0].style.bottom = bottomString;
if(o.zIndexValue) {
background[0].style.zIndex = o.zIndexValue;
}
});
});
}
});
} (jQuery) );