I remember seeing some website or script on the web about this funny / tricky button: Basically it's a button that is impossible to click. When mouseover, it moves randomly away.
Can someone point me to a source or show me few line of code to do that? Preferably using jQuery.
This is probably what you are looking for:
$(function() {
$("button").on({
mouseover: function() {
$(this).css({
left: (Math.random() * 200) + "px",
top: (Math.random() * 200) + "px",
});
}
});
});
button {
position: absolute;
top: 10px;
left: 10px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button>button</button>
http://jsfiddle.net/9CDtE/4/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With