diff options
author | id_ed25519_bbb.git <joak@nospace.at> | 2016-12-19 13:59:01 +0100 |
---|---|---|
committer | id_ed25519_bbb.git <joak@nospace.at> | 2016-12-19 13:59:01 +0100 |
commit | 3c08a384d5471bca3e414091aeef9afcfb9ba668 (patch) | |
tree | 5542c856c5694b5b217ba1703e453b65b5695c06 /2016_lamp_browser/chrome/lamp.js | |
parent | bc37ec21ad65fbd4284e0d75dc372532a33dbd7b (diff) |
add lamp and mirror
Diffstat (limited to '2016_lamp_browser/chrome/lamp.js')
-rw-r--r-- | 2016_lamp_browser/chrome/lamp.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/2016_lamp_browser/chrome/lamp.js b/2016_lamp_browser/chrome/lamp.js new file mode 100644 index 0000000..b732f8d --- /dev/null +++ b/2016_lamp_browser/chrome/lamp.js @@ -0,0 +1,22 @@ +document.addEventListener('DOMContentLoaded', init); + +function init(){ + var elem = document.getElementById('on'); + elem.addEventListener('click',funcon); + var elem2 = document.getElementById('off'); + elem2.addEventListener('click',funcoff); +} + +function funcon(){ + chrome.tabs.insertCSS({ + code: "body{transition: opacity 0.2s ease-in; opacity: 1}" + }); +} + +function funcoff(){ + chrome.tabs.insertCSS({ + code: "body{transition: opacity 0.2s ease-in; opacity: 0}" + }); +} + + |