css - Get browser width and height append divs jQuery -


i'm trying browser width , height , append 2 different div's 2 different positions using jquery.

div 1 should absolute positioned, 40px left , 40px bottom of browser window whilst div 2 should 40px right , 40px bottom, no matter device looking @ webpage (so must work on ipad, iphone's etc.).

i have content (images, child divs , text) sitting within both div's haven't clue how approach i'm useless jquery.

could me out this?

you don't need jquery (the positioning, @ least). css has enough tricks.

don't use absolute positioning, use fixed:

#div-1, #div-2 {position:fixed;} #div-1 {left:40px; bottom;40px;} #div-2 {right:40px; bottom;40px} 

with position:fixed, left, right, top, , bottom properties refer how far respective edge of fix-positioned object respective edge of viewport.

...so won't matter apped divs. append them body:

var mydivshtml = howeveryougetyourdivs(); $('body').append(mydivshtml) 

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 -