Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Created July 30, 2019 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BMU-Verlag/91593500dab2c4eb76c849b9136059af to your computer and use it in GitHub Desktop.
Save BMU-Verlag/91593500dab2c4eb76c849b9136059af to your computer and use it in GitHub Desktop.
<script type="text/javascript">
var coordX = 100;
var coordY = 100;
function moveSlider(slider) {
if (slider.id == "slider-x") coordX = slider.value*5;
if (slider.id == "slider-y") coordY = slider.value*5;
var rectangle = document.getElementById("rectID");
rectangle.setAttribute("transform", "translate("+coordX+","+coordY+")");
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment