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

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

jquery-10-2放置插件問題

jquery-10-2放置插件問題

<!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> ????????<title>放置插件</title> ????????<link?href="style.css"?rel="stylesheet"?type="text/css"?/> ????????<script?src="http://www.xianlaiwan.cn/data/jquery-1.8.2.min.js"?type="text/javascript"></script> ????????<script?src="http://www.xianlaiwan.cn/data/jquery-ui-1.9.2.min.js"?type="text/javascript"></script> ????</head> ???? ????<body> ????????<div?id="divtest"> ????????????<div?class="box"> ????????????????<div?class="title">產品區</div> ????????????????<div?class="drag"><div>蘋果</div></div> ????????????</div> ????????????<div?class="box"> ????????????????<div?class="title">回收站<span?id="number">?(0)</span></div> ????????????????<div?class="cart"><div?id="tip">還沒有產品</div></div> ????????????</div> ????????</div> ???????? ????????<script?type="text/javascript"> ????????????$(function?()?{ ????????????????$(".drag").draggable(); ????????????????var?intSum=0; ??????????????? ????????????????var?isInsert=false; ????????????????$(".cart").droppable({ ????????????????????drop:?function?()?{ ????????????????????????if(isInsert){return;}else{isInsert?=?true;} ????????????????????????????$(this).addClass('focus'); ????????????????????????????intSum++; ????????????????????????????$("#tip").html(""); ????????????????????????????$("#number").html("?("+intSum+")"); ???????????????????????? ?????????????????????????}, ????????????????????out:?function(){ ????????????????????????????intSum--;? ???????????????????????????if(intSum?==?0){? ??????????????????????????????$(this).removeClass("focus").find("#tip").html("還沒有產品"); ????????????????????????????} ????????????????????????????$("#number").html(intSum); ???????????????????????????isInsert=false; } ???????????????????? ??????????????? ???????????????????????????? ???????????????????????? ????????????????}) ????????????}); ????????</script> ????</body> </html>這個代碼里面,當只有一個移動物體的時候,intNum的數量是正常顯示的,但是當移動的物體有很多的時候,就不對了?該怎么辦呢
查看完整描述

1 回答

?
MaxJin

TA貢獻4條經驗 獲得超1個贊

把這行?<script?src="http://www.xianlaiwan.cn/data/jquery-1.8.2.min.js"?type="text/javascript"></script>去掉

查看完整回答
1 反對 回復 2016-05-27
  • 1 回答
  • 0 關注
  • 1143 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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