js弹出两个div层,高度的问题,求大神指导

qingwadaxia_1 2017-06-13 02:50:26
js定时弹出两个div层 但是最下面那个会遮挡一部分,需要下拉才能看 ,如图:


要怎样才能让它弹出的时候,让下面那个div展现完全,如下图, 而不需要往下拉才可以看到


...全文
197 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
设置容器scrollTop为99999999 var bx1 = document.getElementById('bx1'); var bx2 = document.getElementById('bx2'); setTimeout(function () { bx1.style.display = 'block' $('.wp02')[0].scrollTop = 99999999; }, 1000); setTimeout(function () { bx2.style.display = 'block' $('.wp02')[0].scrollTop = 99999999; }, 2000); 如果其他地方还要往.wp02增加内容,继续执行一次红色代码
qingwadaxia_1 2017-06-14
  • 打赏
  • 举报
回复
引用 4 楼 showbo 的回复:
设置容器scrollTop为99999999 var bx1 = document.getElementById('bx1'); var bx2 = document.getElementById('bx2'); setTimeout(function () { bx1.style.display = 'block' $('.wp02')[0].scrollTop = 99999999; }, 1000); setTimeout(function () { bx2.style.display = 'block' $('.wp02')[0].scrollTop = 99999999; }, 2000); 如果其他地方还要往.wp02增加内容,继续执行一次红色代码
大神 直接把你的代码替换下吗 好像不可以啊
qingwadaxia_1 2017-06-13
  • 打赏
  • 举报
回复
有人回答吗??
二月十六 2017-06-13
  • 打赏
  • 举报
回复
找找版主给你移到JavaScript版吧,这里是搞sql的
qingwadaxia_1 2017-06-13
  • 打赏
  • 举报
回复
我的代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no"/>
<meta http-equiv="pragma" content="no-cache" />
<title></title>
<base target="_blank">
<link href="css/phonecommon.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery.min.js"></script>
</head>

<body>
<header>
    <div class="top">
        <h2><a href="javascript:void(0)" onclick="LR_HideInvite();openZoosUrl();return false;"><img src="picture/top_ico2n2.png"></a></h2>
        <h3><a href="/"><img src="picture/top_ico32n1.png"></a></h3>
    </div>
    <div class="img"><a href="javascript:void(0)" onclick="LR_HideInvite();openZoosUrl();return false;"><img src="picture/log23o.jpg"></a></div>
	<div  style="height:1em;"></div>
</header>
<article>
    <section>
        <div class="wp01">
            <dl>
                <dt><a href="javascript:void(0)" onclick="LR_HideInvite();openZoosUrl();return false;"><img src="picture/zj_pic122.jpg"></a></dt>
                <dd> <a href="javascript:void(0)" onclick="LR_HideInvite();openZoosUrl();return false;">
                    <h2><span>XXX</span>xxx</h2>
                    <h3><img src="picture/zj_ico2n1.png">xxxxxxxx</h3>
                    <h3><img src="picture/zj_icon21.png">xxxxxxxx</h3>
                    <p><strong>xx</strong>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p>
                    </a> </dd>
            </dl>
        </div>
    </section>
    <section>
        <div class="wp02">        	
            <div id="bx1" style="display:none;">
                <dl>
                    <dt><a href="javascript:void(0)" onclick="LR_HideInvite();openZoosUrl();return false;"><img src="picture/x_43zj.jpg"></a></dt>
                    <dd><a href="javascript:void(0)" onclick="LR_HideInvite();openZoosUrl();return false;"></a></dd>                    
                </dl>
            </div>
            <div id="bx2" style="display:none;margin-bottom:8em;">
                <dl>
                    <dt><a href="javascript:void(0)" onclick="LR_HideInvite();openZoosUrl();return false;"><img src="picture/x_z2231j.jpg"></a></dt>
                    <dd><a href="javascript:void(0)" onclick="LR_HideInvite();openZoosUrl();return false;">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</a></dd>
                </dl>
            </div>
            <!--<a href="javascript:void(0)" onclick="LR_HideInvite();openZoosUrl();return false;" style="width:30rem; height:6.5rem; display:block; "></a>-->
        </div>
        <script>
			var bx1 = document.getElementById('bx1');
			var bx2 = document.getElementById('bx2');		
			setTimeout(function() {		
			bx1.style.display = 'block'},1000);
			setTimeout(function() {	
			bx2.style.display = 'block'},2000);
		</script> 
    </section>
	<div style="clear:both;height:2em;"></div>
    <section>
        <div class="wp03">
            <h3><a href="javascript:void(0)" onclick="LR_HideInvite();openZoosUrl();return false;"><img src="picture/send.png"></a></h3>
            <ul>
                <li><a href="javascript:void(0)"><img src="picture/wp3_icon21.png">xxxxxx</a></li>
                <li><a href="javascript:void(0)"><img src="picture/wp3_icon22.png">xxxxxx</a></li>
                <li><a href="tel:0830-6021000"><img src="picture/wp3_ic2on3.png">xxxxxx</a></li>
            </ul>
        </div>
    </section>
</article>
<script>
function GetQueryString($name){
    var $index=document.referrer.indexOf($name+"="),$e='';
    if($index>1){
        $e=document.referrer.substring($index+$name.length+1);
        if(($index=$e.indexOf("&"))>0){
            $e=$e.substring(0,$index);
        }
    }
    return $e;
}
// 调用方法
var $wd=GetQueryString("wd");
if($wd&&$wd.length>0){}else{$wd=GetQueryString("word")}

if($wd&&$wd.length>0){
    $wd=decodeURIComponent($wd);
    $line='xxx,xxx【"<b>'+$wd+'</b>"】xxxxxxxxxxxx<span class="ly-animation-bell on">xxxxxxxxxxxx!</span>xxxxxxxxxxxxxxx?';
}else{
    $line='xxx,xxx<span class="ly-animation-bell on">xxx!</span>xxxxxxxxxxxxxxxxxx';
}

$('.wp02 #bx1 dd a').html($line);

</script>
  



</body>
</html>

87,993

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧