WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Slider problem, Jocke, July 9, 2004
     Re:Slider problem, Erik Arvidsson, July 19, 2004

Subject: Slider problem From: Jocke Date: July 9, 2004

I have a problem with slider which i use in my picture upload form.
When i choose a picture it should instantly display it as a preview.

Then i set the maximum and value of the slidebar to the width of the pic
(they should only be able to downsize the picture)

For this to work i execute the following code when a picture is selected

s.setMaximum(document.getElementById('preview').width);
s.setValue(document.getElementById('preview').width);

The problem

The above code triggers the following function where i change the size of the picture when i drag the slider.

s.onchange = function () {
     document.getElementById('preview').width = s.getValue();
}

My problem would be solved if this code:

s.setValue(document.getElementById('preview').width);

Didn't trigger this code (should only trigger when dragging the slidebar)

s.onchange = function () {
     document.getElementById('preview').width = s.getValue();
}

 

 

 




Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX