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.
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
Post a Comment