02 March 2017

Pissing-me-off moving button



Another funny script. Each time you enter a button with your mouse, the button moves to a random location making it impossible to click. Can be very annoying. But a fun idea for April's fool!




(function jumpingButton() {
        // getting window size
        var windowsize = { height: $(window).height(), width: $(window).width() };
        // affecting all buttons
        $('button, input[type="submit"], input[type="image"]').mouseover(function () {
                top: Math.round(Math.random() * windowsize.height),
                left: Math.round(Math.random() * windowsize.width)