dimanche 3 juillet 2016

my drag & drop is not working

i want move my #timebase1 div into draghere div. now its move only the start of the div, i want to drop it in anywhere inside the dragehere div.

 function funct(e) {

            var id = e.id;
            mouseXY(id);
        }

        function mouseXY(id) {

            //alert(id);
            var x = event.pageX,
              y = event.pageY
            $('#' + id).css({
                top: y,
                left: x + ''
            });
        }        
.activelevel1 {
    background-color: #EA623E;
}
.timescalebase {
    margin-top: 13px;
    height: 7px;
    position: relative;
    width:0px;
    }
  <div id="draghere"style="width:100%;margin-top:25px;">
                <div id="timebase1"draggable="true"class="timescalebase activelevel1" ondrag=funct(this)>
                    
                </div>

Aucun commentaire:

Enregistrer un commentaire