jquery ajax加载和淡入joomla
在我的joomla站点中,我使用以下代码加载带有Ajax的页面:jquery ajax加载和淡入joomla,jquery,ajax,joomla2.5,Jquery,Ajax,Joomla2.5,在我的joomla站点中,我使用以下代码加载带有Ajax的页面: jQuery(document).ready(function(){ jQuery("#<?php echo $item->alias; ?>").click(function(){ jQuery('#interno').fadeOut(500, function ck_load(){ jQuery('#principale').load('<?php echo $ck_link; ?
jQuery(document).ready(function(){
jQuery("#<?php echo $item->alias; ?>").click(function(){
jQuery('#interno').fadeOut(500, function ck_load(){
jQuery('#principale').load('<?php echo $ck_link; ?> #interno', function ck_fade_in() {
jQuery('#interno').fadeIn(3000);
});
});
});
});
jQuery(文档).ready(函数(){
jQuery(“#”)。单击(函数(){
jQuery(“#interno”).fadeOut(500,函数ck#u load(){
jQuery(“#principale”).load(“#interno”,函数ck#u fade_in(){
jQuery(“#interno”).fadeIn(3000);
});
});
});
});
在index.php中,这是div的结构:
...
<div id="principale">
<div id="interno">
// Here is loaded the page from the component
</div>
</div>
。。。
//下面是从组件加载的页面
它在容器div(#interno)淡出后工作并加载页面;但是最终的回调函数没有生效(fadeIn),页面加载时没有任何淡入效果。。。您能帮我解决这个问题吗?您已经传递了一个函数变量作为
的回调函数参数。load
您应该传递如下函数:
jQuery('#principale').load('<?php echo $ck_link; ?> #interno', function() {
jQuery('#interno').fadeIn(3000);
});
jQuery('principale').load('interno',function(){
jQuery(“#interno”).fadeIn(3000);
});
来源
jQuery(document).ready(函数($){
,然后使用$
而不是jQuery
。仍然不起作用…问题应该在其他地方…使fadein正常工作是不可能的,但我用动画不透明度解决了问题,方法是:jQuery(“#principale”).animate({opacity:0.1},500).load(“#interno”).animate({opacity:1500);