The most annoying javascript object
Annoyer class creates an HTML element which is annoyingly moving across the users screen. Even when user scrolls, object moves to visible area. Object tries to find only top of elements.
It is also possible to provide callbacks for different events, for example, to change picture in object, or change object's position on hover, etc. Object's method change also allows to change object to specified or random position
Contents
Download
Example codes
<script type="text/javascript" src="./annoyer.js" ></script> <script type="text/javascript"> //create instance var annoy = new annoyer({ width: 50, height: 50, step: 3, interval: 10, startX: -50, startY: -50, css: {background: "red"}, html: "<p>Text</p>", onmouseover: function(el){el.style.border = "2px solid red";}, onmouseout: function(el){el.style.border = "none";}, oninit: function(el){}, onclick: function(el){}, onfly: function(el, xState, yState){}, onstart: function(el){}, onland: function(el){} }); </script>
Examples in action
Method list
Constructor
| Method name | new annoyer(config); |
| Description | Create annoying element that will move to random visible positions |
| Input parameters |
json config - Json structure with configuration properties
|
| Example input |
//create instance
var annoy = new annoyer({
width: 100,
height: 100,
startX: -100,
startY: -100,
html: "<p>Text</p>",
onmouseover: function(el){el.style.border = "2px solid red";},
onmouseout: function(el){el.style.border = "none";}
});
|
Change objects position
| Method name | change() or change(x,y) |
| Description | Move object to another position |
| Input parameters |
int x - position on x axis int y - position on y axis if x or y is not specified, will move to a random position |
Latest changes
None for now
You may also be interested in:
Powered by BlogAlike.com










