如何使下面的javascript中的高度随内容多少自适应高度和宽度
<scripttype="text/javascript">$(document).ready(function(){$(".showdiv").click(functi...
<script type="text/javascript">
$(document).ready(function(){
$(".showdiv").click(function(){
var box =150;
var th= $(window).scrollTop()+$(window).height()/1.6-box;
var h =document.body.clientHeight;
var rw =$(window).width()/2-box;
$(".showbox").animate({top:th,opacity:'show',width:600,height:90,right:120},200).show();
$("#zhezhao").css({
display:"block",height:$(document).height()
});
return false;
});
$(".showbox .close").click(function(){
$(this).parents(".showbox").animate({top:0,opacity: 'hide',width:0,height:0,right:0},200).show();
$("#zhezhao").css("display","none");
});
});
</script> 展开
$(document).ready(function(){
$(".showdiv").click(function(){
var box =150;
var th= $(window).scrollTop()+$(window).height()/1.6-box;
var h =document.body.clientHeight;
var rw =$(window).width()/2-box;
$(".showbox").animate({top:th,opacity:'show',width:600,height:90,right:120},200).show();
$("#zhezhao").css({
display:"block",height:$(document).height()
});
return false;
});
$(".showbox .close").click(function(){
$(this).parents(".showbox").animate({top:0,opacity: 'hide',width:0,height:0,right:0},200).show();
$("#zhezhao").css("display","none");
});
});
</script> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询