Can't find a solution to this issue.
This is the code snippet in question:
var new_img = '<img id="' + drag_id + '" rel="' + drop_id + '" class="' + gallery_link + ' drop_out" src="' + drag_src + '" />';
var drop_img = '<div id="' + ($(ui.draggable).attr("id")) + '" class="not-droppable" rel="' + drop_id + '">' + new_img + '</div>';
$(drop_img).hide().prependTo('li[id=' + drop_id + ']').fadeIn(2000);
Upon prepending the div
with the image inside it to the LI
, it automatically adds a style:display-block
attribute to the div
. How can I avoid this and ensure that the prepended div
maintains the original display: inline-block
set by its class?
I attempted setting the style
attribute on the initial div
tag to display: inline-block
, but it was overridden to display: block
. Trying to declare display: inline-block
as important in the stylesheet resulted in the div
's style
being removed entirely.
Your insights are much appreciated.