Hi,
I’m trying to merge TvTagCloud-Ditto and moofx to manage the rendering of selected docs with ajax.
To achieve this, I’m using moo.fx API, and especially moo.dom.
I’ve changed the TVtagcloud output to add tags values in the rel attributes of the <a> because that was the easy way to me to get them and not parse the href value.(as my english my javascript is basic)
The aim is to get this sequence:
step1: fade out the main div.
step2: load values with ajax in the main div
step3: fade in the main div.
HTML Output
<div id="tagCloud">
<span><a href="ditto.php?id=id&tags=tagvalue" rel="tagvalue" >tagvalue</a></span>
</div>
JS CODE
window.onload = function(){
//create new fx to display query results
var display = new fx.Opacity('main',{duration:500});
//Get all <a> tag contained in #tagCloud span
//moo.dom function $S()
$S('#tagCloud span a').action({
//add each element onclick behaviour
onclick: function(){
//disable link because of <base ref> in <header>
this.href = 'javascript:;';
display.toggle(); //active fx(hide)
//request result
var myAjax = new Ajax.Updater( 'main',
'index.php?id=25',
{method:'get',
parameters:'&tags='+this.rel,
onComplete:function(){
//active fx(show)
display.toggle();
}
});
}
});
}
For now, everything works fine in FF 1.5 but fails in safari.
The first moofx effect works, the datas are loaded and displayed but at the end the main layer which contains the results disappears.
Any idea???
Hope that makes sense.
:-)