css - Overlap a new Div created with Jquery? -
so... it's kind of same problem before. want create new div when key pressed. create it, puts off background.
function attack() { $("body").append("<div class='proj'></div>"); $(".proj").css("position", "absolute"); $(".proj").css("width", "32px"); $(".proj").css("height", "32px"); $(".proj").css("background-color", "#00ffff"); $(".proj").css("left", playerpositionleft); $(".prok").css("top", playerpositiontop); $(".proj").css("z-index", "2"); }
the cyan box .proj need @ red square's location.
hope can help!
don't append <div class='proj'></div>
in body
. append in div
containing big image. , please remember add position:relative
div
Comments
Post a Comment