SHARE
TWEET

Untitled

a guest Jan 27th, 2020 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.             if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
  3.                 console.log("User is using dark mode");
  4.                 $('.trigger-button').trigger('click');
  5.                 /*$('.togglebutton').on('click', function(){
  6.                     alert("Button pressed");
  7.                 });
  8.                 eventFire(document.getElementById('togglebutton'), 'click');*/
  9.             }
  10.             /*function eventFire(el, etype){
  11.                 if (el.fireEvent) {
  12.                     el.fireEvent('on' + etype);
  13.                 } else {
  14.                     var evObj = document.createEvent('Events');
  15.                     evObj.initEvent(etype, true, false);
  16.                     el.dispatchEvent(evObj);
  17.                 }
  18.             }*/  
  19.         </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top