Comments (2)
jQuery Plugin:
- add local var and public method
var isStop = false; //console.log(isStop); $.fn.fakeLoader.stop = function () { isStop = true; //console.log('call outside ' + isStop); };
- check timeToHide is 0 or not, if 0 mean set interval timer to check 'isStop' value
if (settings.timeToHide > 0) { setTimeout(function () { $(el).fadeOut(); }, settings.timeToHide); } else { var timer = setInterval(function () { //console.log(isStop); if (isStop) { $(el).fadeOut(); clearInterval(timer); } }, 200); }
finally HTML code:
var loader = $('#fakeLoader'); // show loader.fakeLoader(); // disapear loader.fakeLoader.stop();
from fakeloader.js.
Thanks @changyushun !
from fakeloader.js.
Related Issues (20)
- npm package HOT 2
- Can I replace Jquery with Zepto Js?
- plugin simply doesn't work HOT 6
- It does not cover navbar?
- It blinks when switch between pages? HOT 1
- Time to hide HOT 1
- fakeloader on 1 page. HOT 1
- There is no git tags on GitHub repository HOT 1
- Uncaught TypeError: a.indexOf is not a function” error on load HOT 2
- problem before preloader HOT 1
- npm support HOT 2
- How can i pro-grammatically close the fake loader. i want to close it on an event. HOT 3
- Uncaught TypeError: jQuery(...).fakeLoader is not a function HOT 2
- Dependency on jQuery HOT 1
- Error using script with jQuery 3.3.1 HOT 1
- TypeScript typing files
- fakeloader doesn't work with 3x version of jquery HOT 3
- bgColor: gradient?
- $.fakeLoader is not a function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fakeloader.js.