Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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?

irt.org | Knowledge Base | DHTML | Q1226 [ previous next ]

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?

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.