第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

完成了一個點(diǎn)觸發(fā)div縮放功能,請問如何完成8個點(diǎn)的觸發(fā)?

完成了一個點(diǎn)觸發(fā)div縮放功能,請問如何完成8個點(diǎn)的觸發(fā)?

葡萄3 2016-08-25 11:07:14
<script?type="text/javascript"> ?????function?g(id){return?document.getElementById(id)} ??????var?mouseOffsetX?=?0; ??????var?mouseOffsetY?=?0; ??????isDraging?=?false; ?????g('boxR').onmousedown?=?function(e){ ???????var?e?=e; ????????mouseOffsetX?=?e.clientX?-?g('boxR').offsetLeft; ????????mouseOffsetY?=?e.clientY?-?g('boxR').offsetTop; ????????isDraging?=?true; ?????} ?????document.onmousemove?=function(e){ ???????var?e?=?e; ???????var?moveX?=?0; ???????var?moveY?=?0; ???????if?(isDraging?===?true)?{ ???????????moveX?=?e.clientX?-?mouseOffsetX; ???????????moveY?=?e.clientY?-?mouseOffsetY; ???????????g('box').style.width?=?moveX?+?'px'; ???????????g('box').style.height?=?moveY?+?'px'; ???????} ?????} ?????document.onmouseup?=function(e){ ???????isDraging?=?false; ?????}??? ????</script>?上面是js部分。<div?class="box"?id="box"> ??????<div?class="boxL"?id="boxL"></div> ??????<div?class="boxT"?id="oxT"></div> ??????<div?class="boxR"?id="boxR"></div> ??????<div?class="boxB"?id="oxB"></div> ??????<div?class="boxLT"?id="boxLT"></div> ??????<div?class="boxRT"?id="boxRT"></div> ??????<div?class="boxLB"?id="boxLB"></div> ??????<div?class="boxRB"?id="boxRB"></div> ????</div>上面是html部分<style?media="screen"> ??????.box{width:?200px;height:?200px;position:?absolute;left:?100px;top:?100px;border:?1px?solid?black;} ??????.boxL,.boxR,.boxT,.boxB,.boxLT,.boxRT,.boxRB,.boxLB{position:?absolute;} ??????.boxL{left:?0;top:50%;width:?10px;height:10px;cursor:?w-resize;background:red;} ??????.boxT{top:?0;left:50%;width:10px;height:10px;cursor:?n-resize;background:red;} ??????.boxR{right:0;top:50%;width:10px;height:10px;cursor:?e-resize;background:red;} ??????.boxB{bottom:?0;left:50%;width:10px;height:10px;cursor:?s-resize;background:red;} ??????.boxLT{left:0;top:0;width:10px;height:10px;background:red;cursor:nw-resize;} ??????.boxRT{width:?10px;height:10px;cursor:ne-resize;background:red;right:0;top:?0;} ??????.boxLB{width:?10px;height:10px;cursor:sw-resize;background:red;left:0;bottom:0;} ??????.boxRB{width:?10px;height:10px;cursor:se-resize;background:red;right:0;bottom:0;} ????</style>上面是css部分,求大神們解惑,
查看完整描述

1 回答

?
去看天荒地老

TA貢獻(xiàn)30條經(jīng)驗(yàn) 獲得超5個贊

循環(huán)啊,getElementsByTagName獲取一組,for循環(huán)為每個加上縮放

查看完整回答
反對 回復(fù) 2016-08-25
  • 1 回答
  • 0 關(guān)注
  • 1379 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號