ForgeKomponensek
hu

Komponensek

j-AutoSelect

jComponent 20 · jcomponent@20 component Példa betöltve a jComponent 20-szal
  • Szingapúr

A komponens automatikusan hozzáadja a .selected osztályot a class="autoselect" kiválasztó szerint az egész HTML dokumentumon belül.Ez a komponens tökéletes megoldás a szerver oldalán történő rendereléshez és a későbbi kiemeléshez.

konfiguráció:

  • selector {String} egy jQuery kiválasztó (default: .autoselect a)
  • A class {String} egy kiválasztott elem osztálynév (default: selected)

Használja a <ui-component name="autoselect">Amennyiben a készülék még nem tölthető le, jComponent letöltés az első felhasználásra a címről DEF.fallback (Azt a Componentator A szerző: Peter Širka. forrás: a Componentator Az összetevők raktár, MIT licenc.

example.html
<style>
	.links a { display: block; border: 0; text-align: left; color: gray; font-size: 14px; border-radius: 2px; padding: 2px 10px; margin-bottom: 1px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; position: relative; }
	.links a i { width: 14px; text-align: center; font-size: 12px; margin-right: 7px; color: #4285F4; }
	.links .selected { font-weight: bold; color: white !important; background-color: #4285F4; }
	.links .selected i { color: white !important }
	.links a:hover { text-decoration: none; color: black; }
</style>

<ui-component name="autoselect" path="NAV.url"></ui-component>

<div class="links autoselect">
	<div class="m">Menu 1</div>
	<a href="/"><i class="ti ti-users"></i>Users</a>
	<a href="/products/"><i class="ti ti-box"></i>Products</a>
	<a href="/settings/"><i class="ti ti-cog"></i>Settings</a>
</div>
<br />
<div class="links autoselect">
	<div class="m">Menu 2</div>
	<a href="/"><i class="ti ti-users"></i>Users</a>
	<a href="/products/"><i class="ti ti-box"></i>Products</a>
	<a href="/settings/"><i class="ti ti-cog"></i>Settings</a>
</div>

<script>

	var arr = ['/', '/products/', '/settings/'];

	setInterval(function() {
		REDIRECT(arr[(Math.random() * arr.length) >> 0]);
	}, 1500);

</script>