j-ASelected
- schreibgeschützt
Die Komponente fügt die Klasse selected zum Element <a hinzu, wenn das Attribut href des Elements eine URL-Adresse aus dem Webbrowser enthält. Es ist auf öffentliche Websites ausgerichtet.
Konfiguration:
class {String}ist ein Klassenname für das ausgewählte Element (Standard:selected)selector {String}ist ein jQuery-Selektor (Standard:a)attr {String}-Attribut zum Vergleichen (Standard:href)strict {Boolean}ermöglicht den strikten Vergleich der URL-Adresse (Standard:false)delay {Number}eine Verzögerung für die erneute Bindung der Auswahl, wenn das Modell geändert wird (Standard:300)- NEU:
watch {String}ein Pfad zum Beobachten von Änderungen
Verwenden Sie es mit <ui-component name="aselected">. Wenn die Komponente noch nicht geladen ist, lädt jComponent sie bei der ersten Verwendung von der Adresse in DEF.fallback (standardmäßig das CDN Componentator) herunter. Autor: Peter Širka. Quelle: Componentator-Komponenten-Repository, MIT-Lizenz.
<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="aselected" class="links">
<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>
</ui-component>
<script>
var arr = ['/', '/products/', '/settings/'];
setInterval(function() {
REDIRECT(arr[(Math.random() * arr.length) >> 0]);
}, 1500);
</script>