ForgeKomponenty
cs

Komponenty

j-InfiniteScroll

jComponent 20 · jcomponent@20 component Příklad načten s jComponent 20

Konfigurace:

  • parent {String} je rodný prvek v důsledku výšky kontejneru (předvolený: parent)
  • margin {Number} a marže pro height (předvolený: 0 px)
  • padding {Number} - podkroví pro čtení (příloha: 50 px)
  • autoscroll {Number} automaticky otáčí kontejner, pokud je obsah přidán (příloha: 100 px)
  • exec {String} odkaz na metodu, která je spuštěna, pokud je řádek na konci, podívejte se na implementaci níže:
function method_append(next, element, init) {
	// @next {Function(new_content)}
	// @element {jQuery}
	// @init {Boolean} Is the component initialized?

	// element.append(...);
	// or
	next('NEW_HTML_CONTENT_or_RAW_NODE_ELEMENT');
}

Použijte ji s <ui-component name="infinitescroll">Pokud je součástka ještě nezačleněna, jComponent Stáhnout ji na první použití z adresy DEF.fallback a) The Componentator CDN dle předvolby. autor: Peter Širka. zdroj: Componentator Výrobce je autorizován, MIT licence.

example.html
<div style="width:500px;height:300px;border:1px solid red">
	<ui-component name="infinitescroll" config="exec:add_new_content">
		<div style="height:1000px">Some content</div>
	</ui-component>
</div>

<script>
	function add_new_content(next, el, init) {

		// init
		if (init)
			return;

		setTimeout(function() {
			// el.append(...);
			// or
			next('<div style="height:500px">' + new Date().format('HH:mm:ss') + '</div>');

			// or if the content doesn't exist:
			// next();
		}, 1000);
	}
</script>