添加類我有禁止的用戶列表,它看起來像這樣:如何爲某些元素從列表
代碼:
<div class="panel">
<div class="inner">
<h3>{L_UNBAN_TITLE}</h3>
<p>{L_UNBAN_EXPLAIN}</p>
<!-- IF S_BANNED_OPTIONS -->
<fieldset>
<!-- EVENT mcp_ban_unban_before -->
<dl>
<dt><label for="unban">{L_BAN_CELL}{L_COLON}</label></dt>
<dd><select name="unban[]" id="unban" multiple="multiple" size="5" onchange="if (this.selectedIndex != -1) {display_details(this.options[this.selectedIndex].value);}">{BANNED_OPTIONS}</select></dd>
</dl>
<dl>
<dt>{L_BAN_LENGTH}{L_COLON}</dt>
<dd><strong id="unbanlength"></strong></dd>
</dl>
<dl>
<dt>{L_BAN_REASON}{L_COLON}</dt>
<dd><strong id="unbanreason"></strong></dd>
</dl>
<dl>
<dt>{L_BAN_GIVE_REASON}{L_COLON}</dt>
<dd><strong id="unbangivereason"></strong></dd>
</dl>
<!-- EVENT mcp_ban_unban_after -->
</fieldset>
</div>
</div>
所以我需要添加類與jQuery只從列表中的用戶。
如何做到這一點?它需要檢查禁止列表,然後從列表中爲這些用戶添加類?
的問題是,我不知道誰將會被禁止,我不能設置VAR
像這樣:var $ =禁止「殭屍」;
因爲我不知道是禁止或不是...所以該功能需要檢查列表,然後添加類從列表中的用戶。
謝謝
一些事情顯示代碼不是一個圖像 – Satpal
我編輯的問題... – senf
首先你需要管理JS禁止的用戶列表,而不是隻作爲html標記!然後,你可能想申請在所有的客戶端上添加這個類,僅限於禁止用戶的mod,對吧?那麼你需要告訴我們你如何存儲和傳播這種狀態。 – Thomas