Jump to content
Sign in to follow this  
brunomartins

Mudar de cor no drag drop

Recommended Posts

Pessoal por favor me ajudem....

Como fazer com que quando eu colocasse uma imagem em uma div ele ficasse de uma cor e quando eu tiro fica a cor que esta antes...

por favor socorro...

 

ta ae o codigo...

 

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Cickweb | Drag n Drop</title>
<script src="js1.js" type="text/javascript"></script>
<link rel ="stylesheet" href="css.css">
<!--<script type="text/javascript" src="jquery.js"></script>-->
<meta name="Robots" content="noindex,nofollow" />
</head>
<body>
<div id="mainContainer">
<div id="tabs1" class="tab-content">
<div id="words">
<div id="dropContent">
<div class="dragableBox" id="box1"><img src="02.jpg" width="30px"></div>
<div class="dragableBox" id="box2"><img src="02.jpg" width="30px"></div>
</div><!-- /dropContent -->
</div><!-- /words -->
<div id="pictures">
<div id="box106" class="dragableBoxRight"></div>
<div id="box101" class="dragableBoxRight"></div>
<div id="box107" class="dragableBoxRight"></div>
<div id="box109" class="dragableBoxRight"></div>
<div id="box104" class="dragableBoxRight"></div>
<div id="box108" class="dragableBoxRight"></div>
<div id="box102" class="dragableBoxRight"></div>
<div id="box105" class="dragableBoxRight"></div>
<div id="box103" class="dragableBoxRight"></div>
</div>
<div class="clear"></div>
<div class="konaBody"></div>
</div>
<div id="tabs2" class="tab-content">
</div>
<script type="text/javascript">// Custom drop action for the picture boxes
var dragDropObj = new DHTMLgoodies_dragDrop();
dragDropObj.addSource('box1',true);
dragDropObj.addSource('box2',true);
dragDropObj.addTarget('box101','dropItems');
dragDropObj.addTarget('box102','dropItems');
dragDropObj.addTarget('box103','dropItems');
dragDropObj.addTarget('box104','dropItems');
dragDropObj.addTarget('box105','dropItems');
dragDropObj.addTarget('box106','dropItems');
dragDropObj.addTarget('box107','dropItems');
dragDropObj.addTarget('box108','dropItems');
dragDropObj.addTarget('box109','dropItems');
dragDropObj.addTarget('words','dropItems');
dragDropObj.init();
</script>
<script>
function dropItems(idOfDraggedItem,targetId,x,y){
var targetObj = document.getElementById(targetId);
var subDivs = targetObj.getElementsByTagName('DIV');
if(subDivs.length>0 && targetId!='words')return;
var sourceObj = document.getElementById(idOfDraggedItem);
targetObj.appendChild(sourceObj);
}
</script>
</body>
</html>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.