СПСБ! Работает, НО! Почемуто через РАЗ!
Т.е. жмешь ссылку, страница грузится полностью, жмешь вторую - грузиться АЯКС. И так далее через раз...
Что это может быть?
Аналогичная проблема, есть её решение?
Title так и не заработал
если кликнуть по фильтру с главной (фильтр тот, что слева), то нечего не происходит
// Разобрался, делал для mod_vm_cherry_picker
заходим в mod_vm_cherry_picker, открываем writer.php
строка примерно 365, там есть js:
static function addScript(){
?>
<script type="text/javascript">
<?php if(chpconf::option('type')==0 && chpconf::option('collapsehead')){ ?>
$$('#chpNav<?php echo chpconf::option('module_id'); ?> .chp-collap').each(function(div){
var trig=div.getElement('h2');
var block=trig.getNext();\
...
</script>
стираем и вставляем:
$$('#chpNav32 .chp-collap').each(function(div){
var trig=div.getElement('h2');
var block=trig.getNext();
var fx=new Fx.Slide(block,{duration:200, onComplete:function(){
trig.getFirst().toggleClass('down');
var cont=block.getParent();
if(cont.getStyle('height').toInt()!=0) cont.setStyle('height','');
}
});
trig.addEvent('click', function(){
fx.toggle();
});
});
var currEffect;
$$('.chp-seemore').addEvent('click',function(){
var trig=this;
var list=trig.getNext(); if(list.hasClass('hid')){
trig.getFirst().innerHTML='-';
trig.getElement('.chp-smt').innerHTML='Свернуть...';
if(currEffect){currEffect.stop();currEffect=null;}
list.setStyle('opacity',0);
list.removeClass('hid');
var fade=list.effect('opacity', {
duration: 400,
transition: Fx.Transitions.Quad.easeInOut
});
currEffect=fade;
fade.start(0,1);
}else{
list.addClass('hid');
trig.getFirst().innerHTML='+';
trig.getElement('.chp-smt').innerHTML='Развернуть...';
}
});
$$('.chpNav a').addEvent('click',function(event){
var link=this.getAttribute('href');
var container=$('chpNav32');
var url='http://moisait.ru/modules/mod_vm_cherry_picker/ajax/getmodule.php';
href=link.substr(link.indexOf('?')+1);
href+='&mid=32';
container.setStyle('position', 'relative');
container.appendChild(
new Element(
'div',
{
'styles' : {
'height': container.offsetHeight,
'width': container.offsetWidth,
'position': 'absolute',
'top': 0,
'left': 0,
'background': '#fff',
'opacity': 0.4
}
}
)
);
new AJAX (url,{
method:'get',
data: href,
evalScripts:true,
onRequest: function(){
container.addClass('chp-loading');
},
onComplete: function(){
container.removeClass('chp-loading');
},
update: container
}).request();
event.preventDefault();
});
$$('.chpNav a').each(function (el) {
el.addEvent('click', function (e) {
if (!$('vmMainPage')) return;
//(new Event(e)).preventDefault();
//if (loading) return;
var container = $('vmMainPage').getParent();
var onComplete = function(responseText, responseXML){
var titleNode = responseXML.documentElement.getElementsByTagName('title')[0];
var bodyNode = responseXML.documentElement.getElementsByTagName('body')[0];
document.title = titleNode.textContent || titleNode.text;
container.setHTML(bodyNode.textContent || bodyNode.text);
loading = false;
}
container.setStyle('position', 'relative');
container.appendChild(
new Element(
'div',
{
'styles' : {
'height': container.offsetHeight,
'width': container.offsetWidth,
'position': 'absolute',
'top': 0,
'left': 0,
'background': '#fff',
'opacity': 0.4
}
}
)
);
loading = true;
new Ajax(el.href, {onComplete: onComplete}).request({tmpl: 'xml'});
});
});
chpNav32 и остальные 32 заменяем на свой id
moisait.ru - пишем свой