function docready() {
if ( $(window).width() > 250 ) {
$.adaptiveBackground.run({
selector: '.js-bg img:not(.done)',
success: function($img, data) {
$img.addClass('done').closest('.short-img-holder').find('.short-img-bg').css({'background-color':data.color});
setTimeout(function() {$img.closest('.short-img-holder').addClass('done')}, 100);
}
});
};
$('.short-rate3:not(.done)').each(function(){
var a = $(this),
b = parseInt(a.find('.ratingtypeplusminus').text()),
c = parseInt(a.find('span[id]:last').text());
if ( c >= b && b!=0) {
var m = (c - b)/2,
p = c - m,
perc = (Math.round((c - (c - b)/2)/c*100));
a.html('
рейтинг '+perc+'%
');
} else {
a.html('
рейтинг 0%
');
};
a.addClass('done');
});
};
$(document).ready(function(){
docready();
$('.site-desc').wTextSlicer({
height: '150',
textExpand: 'Развернуть полностью',
textHide: 'Свернуть'
});
$('.filter-sect select').niceSelect();
$('.rate3-short').each(function(){
var a = $(this),
b = parseInt(a.find('.r3-hide .ratingtypeplusminus').text()),
c = parseInt(a.find('.r3-hide span[id]:last').text());
if ( c >= b ) {
var m = (c - b)/2,
p = c - m,
ten = (Math.round((c - (c - b)/2)/c*100))/10,
id = a.data('id'),
srate = $("#srate3-" + id);
a.children('.sr-plus1').append('
'+p+'');
a.children('.sr-minus1').append('
'+m+'');
srate.html('
'+ten+'');
};
a.addClass('rdone');
});
$('.gallery-hidden').each(function() {
var thI = $(this).children('img');
for (i=0; i
'); };
var thIu = $(this).find('li').children('img');
for (i=0; i'); };
$(this).prepend('');
var th = $(this).find('a');
$(this).before('');
th.clone().appendTo('.gallery-shown');
});
if ( $(window).width() > 750 ) {
$('.gallery-shown').fotorama({
nav:'thumbs',
allowfullscreen:'true',
loop:'true',
keyboard:'true',
arrows:'always',
width:'100%',
height:'400px'
});
} else {
$('.gallery-shown').fotorama({
nav:'thumbs',
allowfullscreen:'true',
loop:'true',
keyboard:'true',
arrows:'always',
width:'100%',
height:'300px'
});
};
var tempScrollTop, currentScrollTop = 0;
var header = $('#header');
$(window).scroll(function(){
if ($(this).scrollTop () > 120) {
header.addClass('sticky-hide')
} else {
header.removeClass('sticky-hide')
};
currentScrollTop = $(window).scrollTop();
if (tempScrollTop currentScrollTop ) {
header.addClass('sticky')
};
tempScrollTop = currentScrollTop;
});
$('.js-login').click(function(){
if ( $('.login-overlay').length ');
$('.login-box').prepend('
');
};
$('.login-box, .login-overlay').fadeIn(200);
});
$('body').on('click','.login-overlay, .login-close',function(){
$('.login-box, .login-overlay').fadeOut(200);
});
$(".btn-search").click(function(){
$('#header').toggleClass('is-active');
$(this).find('.fa').toggleClass('fa-search fa-times');
});
if ( $(window).width()
');
};
$('.mmenu-overlay, .mmenu-close').fadeIn(300);
$('.mmenu-panel').addClass('is-active');
});
$('body').on('click','.mmenu-overlay, .mmenu-close',function(){
$('.mmenu-overlay, .mmenu-close').fadeOut(300);
$('.mmenu-panel').removeClass('is-active');
});
$(".add-comm-btn").click(function(){
$("#add-comms").slideToggle(200);
});
$(".reply").click(function(){
$("#add-comms").slideDown(200);
});
$('body').on('click','.ac-textarea textarea, .fr-wrapper',function(){
$('.add-comm-form').addClass('active').find('.ac-protect').slideDown(400);
});
$('.lb-soc a, .ac-soc a').on('click',function(){
var href = $(this).attr('href');
var width = 820;
var height = 420;
var left = (screen.width - width)/2;
var top = (screen.height - height)/2-100;
auth_window = window.open(href, 'auth_window', "width="+width+",height="+height+",top="+top+",left="+left+"menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
return false;
});
$('#dle-content > #dle-ajax-comments').appendTo($('#full-comms'));
$('body').append('