javascript - Invert complete webpage colors and reverse them with single toggle button -


i need make jsfiddle reverse color inversion have tried many methods , tricks failed somehow everytime.

jsfiddle link

above link jsfiddle use on website same button should reverse function isn't doing think there kind of error in it.

specify html , body height , white background instead of transparent:

$("button").click(function () {    $("html").toggleclass("inversed");  });
html, body {    background: white;    height: 100%;    margin: 0;    padding: 0;    box-sizing: border-box;  }    body {    padding: 1em;  }    .inversed {    -webkit-filter: invert(100%);    filter: invert(100%);  }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <button>inverse</button>


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -