Guest User

Untitled

a guest
Jul 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <img src="yourimage" width="100%" height="100%" style="z-index:0"/>
  2.  
  3. <div style="width:100%; z-index:0; height:100%; background: url(1pximage.gif)"></div>
  4.  
  5. body {
  6. background-size: 100%;
  7. }
  8.  
  9. $(function(){
  10.  
  11. $(window).resize(function(){
  12.  
  13. var windowW = $(window).width();
  14. var windowH = $(window).height();
  15.  
  16. //Using above variables you can deside the size of the background image to be set
  17. }).resize();//Trigger the resize event on page load.
  18. });
Add Comment
Please, Sign In to add comment