Please look at the following jsfiddle. It is a simple attempt at getting the jQuery.appear plugin to work. What am I doing wrong?
http://jsfiddle.net/P7v8v/1/
The html is:
<div class = 'bar'>foo</div>
Here is the relevant code:
alert('foo bar');
$('.bar').appear();
$('.bar').on('appear', AlertMe);
function AlertMe() {
alert("alert me");
}
The plugin can be downloaded at https://github.com/morr/jquery.appear#jqueryappear
1) Appear triggers the event on scroll or resize (referencing your javascript fiddle on line 79)
$(window).scroll(on_check).resize(on_check);
2) for the code to work properly enclose it like this:
$(function(){
... your code goes here
});
so it doesn't get executed before the libraries are loaded.
Hope this helps
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