Перейти к содержимому

Реферальная программа Мегаплана


Как вставить куки?

#1 Alex1231

Alex1231
  • Пользователь
  • 27 сообщений
  • Репутация: 0
0

Отправлено 19 Август 2015 - 19:12

Есть код аккордиона. Не знаю как нужно правильно поставить куки

$(function () {

    $('.accordion-header').on('click', function (e) {

        var $this = $(this);

        $this.parent('.accordion').toggleClass('expanded');

        $this.next('.accordion-collapse').toggle();

        $this.parent('.accordion').siblings('.accordion').removeClass('expanded').find('.accordion-collapse').hide();
        
        e.stopPropagation();

    });

});
<div class="container">
    <div class="accordion-wrapper">
        <div class="accordion">
            <div class="accordion-header">
                <h3>Header 1</h3><a class="accordion-close">V</a>
            </div>
            <div class="accordion-collapse">
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nec magna at urna auctor eleifend eu vel enim. Nulla facilisi. Praesent interdum tortor a justo aliquet semper. Phasellus venenatis porttitor auctor. Mauris et gravida velit. Nunc tempus nunc velit, id lacinia nisl dignissim ac. Proin quis semper sapien. Vestibulum bibendum lorem nec ligula mattis posuere. Nullam suscipit, massa non dictum auctor, orci ligula condimentum sem, nec ultricies est lorem quis ante. Morbi placerat lacinia egestas.</p>
            </div>
        </div>
        <div class="accordion">
            <div class="accordion-header">
                <h3>Header 2</h3><a class="accordion-close">V</a>
            </div>
            <div class="accordion-collapse">
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nec magna at urna auctor eleifend eu vel enim. Nulla facilisi. Praesent interdum tortor a justo aliquet semper. Phasellus venenatis porttitor auctor. Mauris et gravida velit. Nunc tempus nunc velit, id lacinia nisl dignissim ac. Proin quis semper sapien. Vestibulum bibendum lorem nec ligula mattis posuere. Nullam suscipit, massa non dictum auctor, orci ligula condimentum sem, nec ultricies est lorem quis ante. Morbi placerat lacinia egestas.</p>
            </div>
        </div>
        <div class="accordion">
            <div class="accordion-header">
                <h3>Header 3</h3><a class="accordion-close">V</a>
            </div>
            <div class="accordion-collapse">
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nec magna at urna auctor eleifend eu vel enim. Nulla facilisi. Praesent interdum tortor a justo aliquet semper. Phasellus venenatis porttitor auctor. Mauris et gravida velit. Nunc tempus nunc velit, id lacinia nisl dignissim ac. Proin quis semper sapien. Vestibulum bibendum lorem nec ligula mattis posuere. Nullam suscipit, massa non dictum auctor, orci ligula condimentum sem, nec ultricies est lorem quis ante. Morbi placerat lacinia egestas.</p>
            </div>
        </div>
    </div>
</div>
 body {
    margin: 0;
    padding: 0;
    font-family: Verdana;
    font-size: 12px;
}
.container {
    padding: 20px;
}
.accordion-wrapper {
    width: 80%;
}
.accordion {
    margin: 0 0 20px;
}
.accordion-header {
    display: table;
    width: 100%;
    padding: 10px;
    background-color: #58ACFA;
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
}
.accordion-header h3 {
    float: left;
    width: 90%;
    margin: 0;
}
.accordion-close {
    display: block;
    float: right;
    width: 15px;
    height: 15px;
    position: relative;
    text-indent: -9999px;
}
.accordion-close:after {
    content:"";
    display: block;
    width: 0;
    height: 0;
    position: absolute;
    top: 5px;
    border-color: #fff transparent transparent;
    border-style: solid;
    border-width: 8px;
}
.accordion.expanded .accordion-close:after {
    top: -3px;
    border-color: transparent transparent #fff;
}
.accordion-collapse {
    display: none;
    padding: 0 10px;
}

 

 

  • 0


Оформление форума – IPBSkins.ru