Want images to replace one another not continue to populate the drop section
I am creating a drag and drop section using MooTools and JavaScript, right now in this section all logos are draggable and droppable to the inheriting object (a t-shirt), Which means a user can drag as many logos to this object as he/she wishes. This is the problem, I wish to allow the user the ability to only chose one logo to place on the t-shirt and if they choose another logo it will just replace the logo already existing on the t-shirt. here is the code, any help would be appreciated.
<script type="text/javascript">
function changeColor(color) {
document.getElementById("right").style.backgroundImage = "url("+color+")";
}
window.addEvent('domready', function(){
var drop = $('cart');
var dropFx = drop.effect('background-color', {wait: false}); // wait is needed so that to toggle the effect,
$$('.item').each(function(item){
item.addEvent('mousedown', function(e) {
e = new Event(e).stop();
var clone = this.clone()
.setStyles(this.getCoordinates()) // this returns an object with left/top/bottom/right, so its perfect
Bookmarks