script.js 1.82 KB
$(document).ready(function(){
    $(".active").click(function(){
        return false;
    });
    $(".post_1 .more").click(function(){
        $(this).parent().find('.spoiler').toggle(500);
        return false;
    });
    $(".button2 a, .button3 a").click(function(){
        $(this).toggleClass('opened');
        $(this).parent().find('.spoiler').toggle(500);
        $(this).parent().find(".checked").removeClass("checked");
        return false;
    });
    $('.spoiler input[type="radio"]').click(function(){
        if($(this).is(":checked")){
            $(this).parent().parent().find(".checked").removeClass("checked");
            $(this).parent().addClass('checked');
            return false;
        }
        else{
            $(this).parent().removeClass('checked');
            return false;
        }
    });
    $(".item-to-fade").hide();
    $(".more_colls").click(function(){
        if($(this).hasClass('opened')) {
            $('.item-to-fade').hide();
        } else {
            $('.item-to-fade').show();
        }
        $(this).toggleClass('opened');
        $(this).parent().parent().find(".spoiler").toggle(500);
        return false;
    });


    $(".btn_otz.write").click(function(){
        $(".add_comment").show();
        $(this).parent().hide();
        return false;
    });
    $(".close_comm").click(function(){
        $(this).parent().hide();
        $(".otz_buttons").show();
        return false;
    });
    $(".btn_otz.more1").click(function(){
        $(".hidden:lt(4)").removeClass("hidden");
        if(!$(".hidden").is(".hidden")){
            $(this).remove();
        }
        return false;
    });
    if($("#orderform-username input[type='checkbox']").is(':checked')){
        $(this).parent().find("label").addClass("checked");
    }
    
});