Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aligilan/loading

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aligilan/loading

Very light-weight loading package with vanillajs

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Loading

Very simple and light-weight loading with vanilla-js

Install

npm install @aligilan/loading --save

How to use

1- Import style

Add @aligilan/loading/style.css in header.
Or
In your sass file add @import "~@aligilan/loading/style.css";


2- Import js

let loading = require('@alilan/loading');
let normal_loading = new loading();
normal_loading.toggle(target)


In Laravel:

Import:

path: resources/app.js window.Loading = require('@aligilan/loading');
In your page script tag: let normal_loading = new Loading;

Example:

Use in header tag, when DOM is ready
document.addEventListener("DOMContentLoaded", function(){ normal_loading.toggle('#my-element') });

Or

Use when window loaded:
window.onload = function(){ normal_loading.toggle('#my-element') }


target
Valid target element types are: query-select-string, element-object, element-objects

Now when ever call normal_loading.toggle(target), for first time, that shows loading-spinner (spinner with overlay are inside the target and isn't clickable) and at the next call loading-spinner will disappear.

Or normal_loading.show(target) then normal_loading.hide(target) .

Keywords

FAQs

Package last updated on 06 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc