вопрос
Здравствуйте, помогите.
Подключаю: http://spd125.ru/engine/classes/js/jquery.js
Идет конфликт с чем-то из этого:
http://spd125.ru/templates/main/js/common.js
http://spd125.ru/templates/main/js/common.ie.js
http://spd125.ru/templates/main/js/script_combo.js
http://spd125.ru/templates/main/js/placeholder-min.js
Подключаю: http://spd125.ru/engine/classes/js/jquery.js
Идет конфликт с чем-то из этого:
http://spd125.ru/templates/main/js/common.js
http://spd125.ru/templates/main/js/common.ie.js
http://spd125.ru/templates/main/js/script_combo.js
http://spd125.ru/templates/main/js/placeholder-min.js
<script type="text/javascript">
document.addEvent('domready', function() {
// слайдеры
new Site.Slider('news-slider', {autoplay: true});
new Site.Slider('announcements-slider', {autoplay: true, delay: 10000});
new Site.MultiSlider('video-slider', {fxDuration: 400, nextItemsUrl: '/index/next-items/video/'});
new Site.MultiSlider('mix-slider', {fxDuration: 400, nextItemsUrl: '/index/next-items/mix/'});
new Site.MultiSlider('game-slider', {fxDuration: 400});
if ($('joke-body').getHeight() > 140) {
$('joke-more-link').setStyle('display', 'block');
$('joke-all-link').setStyle('display', 'none');
}
// блок морса
(function() {
var container = $('mors');
var links = container.getElements('.b-mors__head__item__link');
var tabs = container.getElements('.b-mors__tab');
container.getElements('.b-mors__item').each(function(item) {
var detail = item.getElement('.b-bottom-detail');
item.addEvent('mouseenter', function() {
detail.setStyle('left', item.getPosition().x);
detail.inject(container, 'after');
});
item.addEvent('mouseleave', function() {
detail.inject(item.getElement('.b-bottom-detail-wrapper'));
});
});
links.addEvent('click', function(e) {
if (this.hasClass('b-mors__head__item__link_hl')) {
return;
} else if (e) {
e.stop();
clearInterval(autoplayTimer);
}
links.removeClass('b-mors__head__item__link_hl');
this.addClass('b-mors__head__item__link_hl');
var tabNum = this.get('data-tab');
tabs.each(function(tab) {
if (tab.get('data-tab') == tabNum) {
tab.addClass('b-mors__tab_hl');
tab.getElements('img').each(function(img) {
var src = img.get('data-src');
if (src) {
img.src = src;
}
});
} else {
tab.removeClass('b-mors__tab_hl');
}
});
});
tabs.addEvent('mouseover', function() {
clearInterval(autoplayTimer);
});
var tabNum = 1;
var autoplayTimer = (function() {
tabNum++;
tabNum = tabNum > 7 ? 1 : tabNum;
var link = links.filter('[data-tab=' + tabNum + ']');
link.fireEvent('click');
}).periodical(10000);
})();
// jilfond
(function() {
var container = $('jilfond');
if (null == container) {
return;
}
container.getElements('.b-jilfond__checkbox').addEvent('click', function(e) {
if (!e.target.match('label')) {
e.stop();
return;
}
this.toggleClass('b-jilfond__checkbox_hl');
var input = this.getElement('input');
if (input.get('checked')) {
input.erase('checked');
} else {
input.set('checked', 'checked');
}
});
container.getElements('.b-jilfond__radio').addEvent('click', function(e) {
if (!e.target.match('label')) {
e.stop();
return;
}
var curr = this;
curr.getParent('div').getElements('label').each(function(label) {
if (label == curr) {
label.addClass('b-jilfond__radio_hl');
label.getElement('input').set('checked', 'checked');
} else {
label.removeClass('b-jilfond__radio_hl');
}
});
});
container.getElements('.b-jilfond__districts__close, .b-jilfond__district-toggle').addEvent('click', function() {
$('jilfond-districts').toggleClass('b-jilfond__districts_hl');
});
// slider
var offers = container.getElement('.b-jilfond__offers__i');
var offersOffset = 0;
var offersLoaded = false;
var move = function(dir) {
var offersHeight = offers.getHeight();
var doubleHeight = offers.getElement('.b-jilfond__offer').getHeight();
if (dir == 'r') {
offersOffset -= 172;
if (Math.abs(offersOffset) >= offersHeight) {
offersOffset = 0;
}
} else {
offersOffset += 172;
if (offersOffset > 0) {
offersOffset = -(offersHeight - 172);
}
}
offers.setStyle('top', offersOffset);
if (offersLoaded == false) {
offers.getElements('img').each(function(img) {
var dataSrc = img.get('data-src');
if (dataSrc) {
img.set('src', dataSrc);
}
});
offersLoaded = true;
}
}
container.getElement('.b-jilfond__offers__arrow_r').addEvent('click', function() {
move('r');
});
container.getElement('.b-jilfond__offers__arrow_l').addEvent('click', function() {
move('l');
});
})();
});
// подстройка блока афиши
document.addEvent('sidebarchange', function() {
var main = document.getElement('.l-main');
var sidebarStatic = document.getElement('.l-sidebar__static');
var sidebarDynamic = document.getElement('.l-sidebar__dynamic');
var playbill = document.getElement('.b-playbill');
var height = main.getHeight() - sidebarStatic.getHeight() - 19;
sidebarDynamic.setStyle('height', height);
});
window.addEvent('load', function() {
document.fireEvent('sidebarchange');
});
</script>