code_junkie

Dynamic backgroundimages PHP GD

Nov 13th, 2011
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title></title>
  4. <link rel="stylesheet" id="styleSwitch" href="" />
  5.  
  6. <script type="text/javascript">
  7. function getStyle(){
  8. var theStyleLink = document.getElementById('styleSwitch');­
  9.  
  10. if (window.innerWidth < 810){
  11. theStyleLink.setAttribute("href", ­ "small-window.css");
  12.  
  13. }
  14. else {
  15. theStyleLink.setAttribute("href", ­ "large-window.css");
  16.  
  17. }
  18. }
  19. </script>
  20. </head>
  21. <body onload="getStyle();">
  22.  
  23. </body>
  24. </html>
Add Comment
Please, Sign In to add comment