Created
March 26, 2016 23:32
-
-
Save valdiney/f0f9e29ac4f7b1eb3eb5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function aplicaFiltro(filtro, slider, valor, unidade) { | |
var imagem = document.getElementById("meumapa"); | |
var y = document.getElementById(slider); | |
var x = document.getElementById(valor); | |
x.value = y.value+unidade; | |
if('-webkit-filter' in document.body.style) { | |
imagem.style.webkitFilter = filtro+'('+y.value+unidade+')'; | |
} else if ('filter' in document.body.style) { | |
imagem.style.filter = filtro+'('+y.value+unidade+')'; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="range" onchange="aplicaFiltro('brightness', 'rangeBrightness', 'valorBrightness', '%')" value="100" id="rangeBrightness" max="300" min="0"> | |
<input type="text" size="2" value="100%" id="valorBrightness"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment