New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

g-loading

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

g-loading

loading

latest
npmnpm
Version
1.0.0
Version published
Maintainers
0
Created
Source

Introduction

The loading component uses CSS3 animations in Chrome and gifs in IE8.

Usage Scenarios

  • When a part of the page is waiting for asynchronous data or is in the rendering process, an appropriate loading animation can effectively alleviate user anxiety.
  • If a loading animation needs to be added to the entire page, as well as to specific parts of the page.
  • If support for multiple sizes of loading animations is needed to fit different container sizes.

Dependencies

None.

Usage Guidelines

import loading from 'g-loading';

// Three sizes
loading()		// 40x40
loading.small()		// 24x24
loading.large()		// 60x60

// Optional parameters
loading(ele)
loading(ele, 'Loading...')
loading('Loading...')

loading() is equivalent to loading(document.body, 'Loading...')

loading(ele) is equivalent to loading(ele, 'Loading...')

loading('Waiting...') is equivalent to loading(document.body, 'Waiting...')

loading() returns hide method

let hide = loading()
...
// After a period of time
hide()

Each instance is destroyed independently and does not interfere with each other.

Constraints

  • If ele is not set, loading will be rendered on the body by default.
  • If ele is not body, its position property cannot be static, meaning it must be relatively or absolutely positioned.
  • If ele is not body, it must be a div or span.
  • In IE8, the parent selector needs to match .ie8, it is recommended to set the class="ie8" directly on the html element.

Keywords

loading

FAQs

Package last updated on 11 Dec 2024

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