<!-- Uses WebFX "Slider" from http://webfx.eae.net/dhtml/slider/slider.html Author: Erik Arvidsson Licensed under the Apache Software License 2.0, http://webfx.eae.net/license/asl2 This component may be obtained, modified and distributed free of charge for personal as well as commercial use. Please see the license for the complete terms and exact wording. Integration with Jmol by Angel Herráez. --> <script type="text/javascript" src="slider/js/range.js"></script> <script type="text/javascript" src="slider/js/timer.js"></script> <script type="text/javascript" src="slider/js/slider.js"></script> <link type="text/css" rel="StyleSheet" href="slider/css/bluecurve/bluecurve.css" /> <!-- end of Slider -->and also this:
<script type="text/javascript"> var defaultSlab = 80; function toggleSlab() { var ctl = document.getElementById("slabToggle"); if (ctl.checked) { Jmol.scriptWait(myJmol, "spin off; slab on; "); slabSlider.setValue(defaultSlab); applySlab(defaultSlab); } else { Jmol.scriptWait(myJmol, "slab off; "); } } function applySlab(x) { Jmol.script(myJmol, "slab " + x + ";"); } </script>as well as the code needed to define Info and load JSmol.min.js
<div tabIndex="1" class="slider" id="slabSlider" style="width:200px;" >
<input class="slider-input" id="slabSlider-input" name="slabSlider-input" />
</div>
<script type="text/javascript"> // WebFX "Slider" code var slabSlider = new Slider(document.getElementById("slabSlider"), document.getElementById("slabSlider-input"), "horizontal") slabSlider.setMaximum(100)
slabSlider.setMinimum(0)
slabSlider.setUnitIncrement(2) // amount to increment the value when using the arrow keys
slabSlider.setValue(defaultSlab)
slabSlider.onchange = function ()
{ // onchange MUST BE all lowercase
applySlab( document.getElementById("slabSlider-input").value )
}
window.onResize = function () { slabSlider.recalculate() }
</script>