Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1226 Is it possible to make a slider in JavaScript that automatically saves the value of the slider in a variable after you moved the slider?

You are here: irt.org | FAQ | DHTML | Q1226 [ previous next ]

Try:

<script language="JavaScript"><!--
var sliderPos=0;

function moveIt(newPos) {
    if (document.images) {
        document.images['spos'+sliderPos].src='notfilled.gif'
        document.images['spos'+newPos].src='filled.gif'
    }
    sliderPos=newPos;
}
//--></script>

<a href="javascript:;" onClick="return false" onMouseOver="moveIt(0);"><img src="filled.gif" name="spos0" width=10 height=10 border=0></a><a
 href="javascript:;" onClick="return false" onMouseOver="moveIt(1);"><img src="notfilled.gif" name="spos1" width=10 height=10 border=0></a><a
 href="javascript:;" onClick="return false" onMouseOver="moveIt(2);"><img src="notfilled.gif" name="spos2" width=10 height=10 border=0></a><a
 href="javascript:;" onClick="return false" onMouseOver="moveIt(3);"><img src="notfilled.gif" name="spos3" width=10 height=10 border=0></a><a
 href="javascript:;" onClick="return false" onMouseOver="moveIt(4);"><img src="notfilled.gif" name="spos4" width=10 height=10 border=0></a><a
 href="javascript:;" onClick="return false" onMouseOver="moveIt(5);"><img src="notfilled.gif" name="spos5" width=10 height=10 border=0></a>

Feedback on 'Q1226 Is it possible to make a slider in JavaScript that automatically saves the value of the slider in a variable after you moved the slider?'

©2018 Martin Webb