Using jQuery UI drag-and-drop: changing the dragged element on drop

Taking the full javascript code from the link you gave, you can change it as follows to make it work: $(function() { $(“.elementbar div”).draggable({ connectToSortable: ‘.column’, cursor: ‘move’, cursorAt: { top: 0, left: 0 }, helper: ‘clone’, revert: ‘invalid’ }); $(“.elementbar div, .elementbar div img”).disableSelection(); $(“.column”).sortable({ connectWith: ‘.column’, cursor: ‘move’, cursorAt: { top: 0, left: … Read more

Timing in JS – multiple setIntervals running at once and starting at the same time?

Good question, but in JS you can’t. To have multiple functions in the same program execute at the same time you need multi-threading and some deep timing and thread handling skills. JS is single threaded. setInterval doesn’t acutally run the function after the delay, rather after the delay it adds the function to the event … Read more

jQuery append div inside div with id and manipulate

It’s just the wrong order var e = $(‘<div style=”display:block; float:left;width:’+width+’px; height:’+height+’px; margin-top:’+positionY+’px;margin-left:’+positionX+’px;border:1px dashed #CCCCCC;”></div>’); $(‘#box’).append(e); e.attr(‘id’, ‘myid’); Append first and then access/set attr.

How to chain ajax requests?

You could have a single function which is passed an integer to state what step the request is in, then use a switch statement to figure out what request needs to be make next: function ajaxQueue(step) { switch(step) { case 0: $.ajax({ type: “GET”, url: “/some/service”, complete: function() { ajaxQueue(1); } }); break; case 1: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)