Coder Social home page Coder Social logo

jquery.appear's Introduction

jQuery plugin to call a function when an element appears

Usage

Mimics a custom 'appear' event, which fires when an element scrolls into view or otherwise becomes visible to the user.

$('#foo').appear(function() {
  $(this).text('Hello world');
});

This plugin can be used to prevent unnecessary requests for content that's hidden or outside the viewable area.

Usage with additional options

$('#foo').appear(function() {
  $(this).text('Hello world');
},{accX: 50, accY: 100});

Will fire 'appear' event with accuracy 50px in X and 100px in Y

http://bas2k.ru/

jquery.appear's People

Contributors

bas2k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery.appear's Issues

$(...).appear is not a function

Hello!
Is there a option to use it with webpack? I am having this issue here but i'm not able to fix it. Would you like to help me?

I have only this config in my webpack config, but appear always is not a function

new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
}),

Add Disappear

This script works great, however it would be good to have a script like this but disappear... so when an element goes out of the window you can reset the values or something like that...

I dont know enough jQuery to do this myself else I would fork and submit a pull request.

dont-work

dont work with jQuery v3.4.1

jquery.min.js:2 Uncaught TypeError: $(...).appear is not a function
at HTMLDocument. (script.js:386)
at e (jquery.min.js:2)
at t (jquery.min.js:2)

Available for hire?

Are you by any chance available for hire? Looking to convert this to vanilla JS - I can do it myself but would rather pay someone to save time if possible. Thanks!

problem

I have problem when I'm on an element that appears with help of appear.js and I refresh the page, I get error "Uncaught TypeError: Property '4' of object [object Array] is not a function" line 126 of appear.js file. This only happens when I'm positionated on "appearing element " when I refresh. Everything works perfect, but I get error. Please someone help me, if you can.

Uncaught TypeError: $.fn.appear.checks[length] is not a function

The error is showing on line 127 for me, but its this code block:

Original (In master Branch, lines 124-128)

//process the queue
    checkAll: function() {
    var length = $.fn.appear.checks.length;
    if (length > 0) while (length--) ($.fn.appear.checks[length])();
},

Updated this block to use:

        //process the queue
        checkAll: function() {
            var length = $.fn.appear.checks.length;
            if (length > 0) while (length--) ($.fn.appear.checks[length])();
            try
            {
                ($.fn.appear.checks[length])();
            }
            catch(e)
            {
            }
        },

but get the same issue even when trying to catch the issue.

Any pointers to a possible solution?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.