<!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>
????????<meta?charset="utf-8">
????????<script?src="http://idcbgp.cn/data/jquery-1.8.2.min.js"?type="text/javascript"></script>
????????<script?src="http://idcbgp.cn/data/jquery-ui-1.9.2.min.js"?type="text/javascript"></script>
????????<style>
????????#divtest
{
????width:?282px;
}??
.box
{
????width:?280px;
????border:?solid?1px?#eee;
????margin:?10px?0px;
}
.box?.title
{
????padding:?8px;
????background-color:?Blue;
????color:?#fff;
????height:?23px;
????line-height:?23px;
????font-size:?15px;
????font-weight:?bold;
}
.box?.drag
{
????padding:?5px;
????cursor:?move;
}
.box?.drag?div
{
????border:?solid?1px?#fff;
????background-color:?red;
????color:#fff;
????cursor:?move;
????width:?35px;
????padding:?20px;
????text-align:?center;
}
.box?.cart
{
????padding:?5px;
????cursor:?move;
}
.box?.cart?div
{
????padding:?5px;
????height:?55px;
????text-align:center;
}
.focus
{
????background-color:?#eee;
}
????????</style>
????</head>
????
????<body>
????????<div?id="divtest">
????????????<div?class="box">
????????????????<div?class="title">產(chǎn)品區(qū)</div>
????????????????<div?class="drag"><div>蘋果</div></div>
????????????????<div?class="drag"><div>香蕉</div></div>
????????????????<div?class="drag"><div>葡萄</div></div>
????????????</div>
????????????<div?class="box">
????????????????<div?class="title">回收站</div>
????????????????<div?class="cart"><div?id="tip">還沒(méi)有產(chǎn)品</div></div>
????????????</div>
????????</div>
????????
????????<script?type="text/javascript">
????????????$(function?()?{
????????????????$(".drag").draggable();
????????????????$(".cart").droppable({
????????????????????drop:?function?()?{
????????????????????????$(this)//這里為什么不能加分號(hào)????
????????????????????????.addClass("focus")//這里為什么不能加分號(hào)????
????????????????????????.find("#tip").html("");
????????????????????}
????????????????})
????????????});
????????</script>
????</body>
</html>搞不清楚什么時(shí)候該加什么時(shí)候不該加
jquery中關(guān)于什么時(shí)候加分號(hào)什么時(shí)候不加分號(hào)的問(wèn)題
csusun
2016-05-03 10:48:21