亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

關于瀑布流相對定位后問題,求大神解答~

關于瀑布流相對定位后問題,求大神解答~

慕姐0693551 2015-12-02 09:50:23
添加了瀑布流的效果之后,想添加個頁腳在下面,但都被瀑布流的圖片覆蓋了,求大神幫忙看看T^T附上代碼<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html?xmlns="http://www.w3.org/1999/xhtml"> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/> <link?rel="stylesheet"?type="text/css"?href="style/web.css"/> <script?type="text/javascript"?src="js/jquery-1.11.3.min.js"></script> <script> $(window).on('load',function(){ ????????waterfall(); ????????var?dataInt={}; ? ????????$(window).on('scroll',function(){ ????????????if(checkScrollSlide()){ ????????????????$.each(dataInt.data,function(key,value){ ????????????????????var?oBox=$('<div>').addClass('box').appendTo($('#mian')); ????????????????????var?oTu=$('<div>').addClass('tu').appendTo($(oBox)); ????????????????????var?oImg=$('<img>').attr('src',$(value).attr('src')).appendTo($(oTu)); ????????????????}) ????????????????waterfall(); ????????????} ????????}) ????}) ????function?waterfall(){ ????????var?$boxs=$('#mian>div'); ????????var?w=$boxs.eq(1).outerWidth(); ????????var?cols=Math.floor($(window).width()/w); ????????$('#mian').width(w*cols).css('margin','0?auto'); ????????var?hArr=[]; ????????$boxs.each(function(index,value){ ????????????var?h=$boxs.eq(index).outerHeight(); ????????????if(index<cols){ ????????????????hArr[index]=h; ????????????}else{ ????????????????var?minH=Math.min.apply(null,hArr); ????????????????var?minHIndex=$.inArray(minH,hArr); ????????????????$(value).css({ ????????????????????'position':'absolute', ????????????????????'top':minH+'px', ????????????????????'left':minHIndex*w+'px' ????????????????}) ????????????????hArr[minHIndex]+=$boxs.eq(index).outerHeight(); ????????????} ????????}) ? ????} ????function?checkScrollSlide(){ ????????var?$lastBox=$('#mian>div').last(); ????????var?lastBoxDis=$lastBox.offset().top+$lastBox.outerHeight(); ????????var?scrllTop=$(window).scrollTop(); ????????//if(contentH?-?viewH?-?scrollTop?<=?100); ????????var?documentH=$(window).height(); ????????console.log(lastBoxDis); ????????console.log(scrllTop?+?documentH); ????????return?(lastBoxDis<=scrllTop+documentH)?true:false; ????} ?</script> <title>無標題文檔</title> </head> <body> <div?class="weizhi"> <img?src="images/zuobiao.png"?/><p>您當前所在位置:<a?href="#">首頁?>?產品展示</p> </div> <div?class="hengxian"> <hr?size="1px"?color="eeeeee"?/> </div> <!--瀑布流--> <div?id="mian"> ? ????<div?class="box"> ????<div?class="tu"> ????<img?src="images/ceshi?(1).jpg"?/> ????</div> ????</div> ??????<div?class="box"> ?? <div?class="tu"> ????<img?src="images/ceshi?(2).jpg"?/> ????</div> ????</div> ??????<div?class="box"> ?? <div?class="tu"> ????<img?src="images/ceshi?(3).jpg"?/> ????</div> ????</div> ??????<div?class="box"> ?? <div?class="tu"> ????<img?src="images/ceshi?(4).jpg"?/> ????</div> ????</div> ??????<div?class="box"> ?? <div?class="tu"> ????<img?src="images/ceshi?(5).jpg"?/> ????</div> ????</div> ??????<div?class="box"> ?? <div?class="tu"> ????<img?src="images/ceshi?(6).jpg"?/> ????</div> ????</div> ??????<div?class="box"> ?? <div?class="tu"> ????<img?src="images/ceshi?(7).jpg"?/> ????</div> ????</div> ??????<div?class="box"> ?? <div?class="tu"> ????<img?src="images/ceshi?(8).jpg"?/> ????</div> ????</div> ??????<div?class="box"> ?? <div?class="tu"> ????<img?src="images/ceshi?(9).jpg"?/> ????</div> ????</div> ??????<div?class="box"> ?? <div?class="tu"> ????<img?src="images/ceshi?(10).jpg"?/> ????</div> ????</div> ?</div> ???? <div?style="clear:both;"></div> <div?class="fy"> </div> </body> </html>*{?padding:0;?margin:0;?font-family:"微軟雅黑";?list-style:none;?text-decoration:none;?font-size:15px;?outline:none;} .weizhi{height:30px;margin-top:80px;?overflow:hidden;} .weizhi?img{?float:left;margin-left:60px;?margin-top:10px;} .weizhi?p{?float:left;?margin-left:10px;?line-height:10px;?font-size:15px;} .weizhi?p?a{?color:#666;} .hengxian{?margin-top:5px;?padding:0?50px?0?60px;} /*瀑布流*/ #mian{position:relative;?z-index:998;} .box{padding:10px?0?0?10px;?float:left;?margin-top:50px;?margin-bottom:20px;} .tu{padding:1px;} .tu?img{width:350px;?height:auto;} /*深灰色框*/ .fy{width:1000px;?height:80px;?background:#333;?margin:0?auto;}
查看完整描述

5 回答

?
慕姐0693551

TA貢獻7條經驗 獲得超0個贊

565fe09f0001551f05000208.jpg

565fe09f0001bea605000203.jpg


這是沒增加圖片和增加圖片后的效果

查看完整回答
反對 回復 2015-12-03
?
慕姐0693551

TA貢獻7條經驗 獲得超0個贊

http://img1.sycdn.imooc.com//565e606700017e3a14710791.jpg

像這樣的額- -

查看完整回答
反對 回復 2015-12-02
  • 李曉健
    李曉健
    這看了下他們的代碼,他是通過js去算了mian的高度,這樣就行了。你可以試一下
  • 慕姐0693551
    慕姐0693551
    大神,我修改了下現在是可以顯示在下面了,但又有新問題了,如果圖片多了之后它又會被圖片覆蓋了,有木有辦法它會隨著圖片的增加自動往下移呢?
?
李曉健

TA貢獻1036條經驗 獲得超461個贊

.fy{width:1000px;?height:80px;?background:#333;?margin:0?auto;position:?fixed;bottom:?0;z-index:?1000;}

試試

查看完整回答
反對 回復 2015-12-02
  • 慕姐0693551
    慕姐0693551
    額,加了FIXED是在前面了,但是卻固定了- -大神有木有辦法就是滾動到底才看的到頁腳額,如下面的圖- -
  • 5 回答
  • 0 關注
  • 1717 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號