ForgeComponents
en

Components

j-Loading

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20
  • it automatically assigns flags @showloading and @hideloading

Configuration:

  • NEW: style {Number} a loading style (default: 1)
    • 1: basic with animated spin
    • 2: a blue line at the top of window

Usage:

  • SETTER('loading/show', [text]) - shows loading (text optional)
  • SETTER('loading/hide', [sleep]) - hides loading (sleep optional and in milliseconds)

Use it with <ui-component name="loading">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

example.html
<style>
	body { background-color: #F0F0F0; }
</style>

<ui-component name="loading" class="hidden"></ui-component>

<div>Lorem ipsum</div>
<div>Lorem ipsum</div>
<div>Lorem ipsum</div>
<div>Lorem ipsum</div>
<div>Lorem ipsum</div>
<div>Lorem ipsum</div>
<div>Lorem ipsum</div>

<script>
	var is = false;
	setInterval(function() {
		is = !is;
		if (is)
			SETTER('loading/show');
		else
			SETTER('loading/hide', 1000);
	}, 3000);
</script>