$(function(){ //将内容插入到body开始处,页面加载完毕后自动展开 //$('body').prepend("
"); $('.lrtk').slideDown(1500,function(){ //$('.lrtk').append(""); $('.lrtk').append(""); }); //设置延时函数 function adsUp(){ $('.lrtk').animate({ height:'0' },1000,function(){ $(this).find('.up').addClass('down').removeClass('up'); }); } //五秒钟后自动收起 var t = setTimeout(adsUp,6000); //点击收起 $('.lrtk a.up').live('click',function(){ clearTimeout(t); $('.lrtk').animate({ height:'0' },function(){ $(this).find('.up').addClass('down').removeClass('up'); }); }); //点击下拉 $('.lrtk a.down').live('click',function(){ $(this).css({ opacity:'0' , filter:'alpha(opacity=0)' }); $('.lrtk').animate({ height:'560px' },function(){ $(this).find('.down').addClass('up').removeClass('down').css({opacity:'1',filter:'alpha(opacity=100)'}); }); }); });