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"); } 

enter image description here

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

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -