将活动类保存到cookie

时间:2014-02-26 09:43:13

标签: jquery class cookies save

我正在寻找将活动类(class="active")保存到cookie的解决方案。 我该怎么处理?我想保存每次点击的cookie。 因此,每次用户更改某些内容时,都会保存cookie。 这是我的HTML代码。顺便说一句,我使用JQuery。

<nav class="controls col_12 column">
    <div class="group" id="Filtersat">
        <div class="drop_down wf">
            <span class="spantext">Regionen</span>
            <ul class="region" style="display: none;">
                <li id="all" class="first" data-filter="all" data-dimension="regionenat">All</li>
                <li id="niederösterreich" data-filter="niederösterreich" data-dimension="regionenat">Niederösterreich</li>
                <li id="steiermark" data-filter="steiermark" data-dimension="regionenat" class="active">Steiermark</li>
                <li id="tirol" data-filter="tirol" data-dimension="regionenat">Tirol</li>
                <li id="vorarlberg" data-filter="vorarlberg" data-dimension="regionenat" class="active">Vorarlberg</li>
                <li id="wien" data-filter="wien" data-dimension="regionenat" class="last">Wien</li>
            </ul>
        </div>
        <div class="drop_down wf">
            <span class="spantext">Leuchtentype</span>
            <ul class="leuchttype" style="display: none;">
                <li id="all2" class="first" data-filter="all" data-dimension="leuchtentypeat">All</li>
                <li id="singel" data-filter="singel" data-dimension="leuchtentypeat">singel</li>
                <li id="duo" data-filter="duo" data-dimension="leuchtentypeat" class="active">duo</li>
                <li id="grande" data-filter="grande" data-dimension="leuchtentypeat" class="active">grande</li>
                <li id="one" data-filter="one" data-dimension="leuchtentypeat" class="">one</li>
                <li id="tow" data-filter="tow" data-dimension="leuchtentypeat" class="">tow</li>
                <li id="three" data-filter="three" data-dimension="leuchtentypeat" class="">three</li>
                <li id="four" data-filter="four" data-dimension="leuchtentypeat" class="last">four</li>
            </ul>
        </div>
    </div>
</nav>

所以我将id添加到<li>。所以我知道我在一个cookie中用id和class来表达li。 Somone知道怎么样?

0 个答案:

没有答案