Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // adjust background transparency for window if needed
- if (Titanium.platform == "win32" &&
- Titanium.UI.currentWindow.getTransparency() < 1)
- {
- var color = "#" + Titanium.UI.currentWindow.getTransparencyColor();
- function replaceTransparent(srcStyle, destStyle)
- {
- if (!destStyle) destStyle = srcStyle;
- if (srcStyle.background == "transparent")
- {
- destStyle.background = color;
- }
- if (srcStyle.backgroundColor == "transparent")
- {
- destStyle.backgroundColor = color;
- }
- }
- replaceTransparent(document.body.style);
- // also check external stylesheets, but still modify the DOM (hurray)
- for (var i = 0; i < document.styleSheets.length; i++)
- {
- for (var j = 0; j < document.styleSheets[i].cssRules.length; j++)
- {
- var rule = document.styleSheets[i].cssRules[j];
- if (rule.selectorText != "body") continue;
- replaceTransparent(rule.style, document.body.style);
- }
- }
- }
Add Comment
Please, Sign In to add comment