?? 樣式:??? ???? <div class="hom-foot">?? ??? ??? ??? ?<div class="hom-foot-txt">?? ??? ??? ??? ??? ?<p>1</p>?? ??? ??? ??? ??? ?<p>2</p>?? ??? ??? ??? ??? ?<p>3</p>?? ??? ??? ??? ??? ?<p>4</p>?? ??? ??? ??? ??? ?<p>5</p>?? ??? ??? ??? ??? ?<p>6</p>?? ??? ??? ??? ??? ?<p>7</p>?? ??? ??? ??? ??? ?<p>8</p>?? ??? ??? ??? ??? ?<p>9</p>?? ??? ??? ??? ??? ?<p>0</p>?? ??? ??? ??? ??? ?<p>1</p>?? ??? ??? ??? ??? ?<p>2</p>?? ??? ??? ??? ??? ?<p>3</p>?? ??? ??? ??? ??? ?<p>4</p>?? ??? ??? ??? ??? ?<p>5</p>?? ??? ??? ??? ??? ?<p>6</p>?? ??? ??? ??? ??? ?<p>7</p>?? ??? ??? ??? ??? ?<p>8</p>?? ??? ??? ??? ??? ?<p>9</p>?? ??? ??? ??? ??? ?<p>0</p>?? ??? ??? ??? ?</div>?? ??? ??? ?</div>.hom-foot{?? ?height: 375px;?? ?width: 100%;?? ?background: #444;?? ?color: #fff;?? ?font-size: 27px;?? ?line-height: 40px;?? ?overflow: hidden;?? ?position: relative;}.hom-foot-txt{?? ?height: 750px;?? ?width: 100%;?? ?background: red;?? ?font-size: 24px;?? ?line-height: 34px;?? ?position: absolute;?? ?top: 0px;?? ?left: 0px;}js:??? var footTxt=$(".hom-foot-txt");?? ?var foot=$(".hom-foot");?? ?var txtHeight=-34;?? ?footTxt.style.top = txtHeight + 'px';?? ?console.log("txtHeight")
一個js的問題,沒辦法用js改變div的top值,提示Cannot set property 'top' of undefined
肖小波
2016-08-28 21:16:52