Guest User

Untitled

a guest
Jul 17th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. // adjust background transparency for window if needed
  2. if(Titanium.platform == "win32") {
  3. if(Titanium.UI.currentWindow.getTransparency() < 1) {
  4. var c = Titanium.UI.currentWindow.getTransparencyColor();
  5. if (document.body.style.background == "transparent")
  6. {
  7. document.body.style.background = "#"+c;
  8. }
  9. if (document.body.style.backgroundColor == "transparent")
  10. {
  11. document.body.style.backgroundColor = "#"+c;
  12. }
  13. // also check external stylesheets, but still modify the DOM (hurray)
  14. for (var i = 0; i < document.styleSheets.length; i++)
  15. {
  16. for (var j = 0; j < document.styleSheets[i].cssRules.length; j++)
  17. {
  18. var rule = document.styleSheets[i].cssRules[j];
  19. if (rule.selectorText == "body")
  20. {
  21. if (rule.style.background == "transparent")
  22. {
  23. document.body.style.background = "#"+c;
  24. }
  25. if (rule.style.backgroundColor == "transparent")
  26. {
  27. document.body.style.backgroundColor = "#"+c;
  28. }
  29. }
  30. }
  31. }
  32. }
  33. }
Add Comment
Please, Sign In to add comment