PDA

View Full Version : slider moving problem



amca.arun
Sep 13th, 2007, 09:15 AM
Hi All:
I encounter a problem in dealing with slider bar moving in javascripts.

The case is that I have created slider bar with ,I have four functionalities in slider bar functions


Please see the below image

(+)----------------|--------------(-)



1) when I click the (+) button the slider is moving (+) direction , when I click (-) button the slider is moving (-) direction .This process was working fine.
//Function for + button
function ZoomInPlus()
{
var zoomLvlText = GetElement('sliderValue');
if( zoomLvlText != null )
{
var zoomValue = zoomLvlText.value;
if( zoomValue < 19)
{
previousZoomLvlValue = zoomValue;
zoomValue++;
SetMapZoomLevel( zoomValue );
}
}
ChangeZoom();
}
//Function for - button
function ZoomOutMinus()
{
var zoomLvlText = GetElement('sliderValue');
if( zoomLvlText != null )
{
var zoomValue = zoomLvlText.value;

if( zoomValue > 1)
{
previousZoomLvlValue = zoomValue;
zoomValue--;
SetMapZoomLevel( zoomValue );
}
}
ChangeZoom();
}
The above coding was working fine.

2) But when I click the mid bar slider right position the slider will go to (-) position and then when I click the mid bar slider left position , the slider will go to (+) position. This is concept. But when I click the mid bar both directionís the slider is going (-) direction only.

function ZoomOutIn()
{
var currnetZoomValue = GetElement('sliderValue');
if ( currnetZoomValue.value < previousZoomLvlValue )
{
ZoomOutMinus();
alert("zoomOutminus");
}
else if (currnetZoomValue.value > previousZoomLvlValue )
{
ZoomInPlus();
alert("zoomIn");
}
else
{
alert("Equal");
}
}
The above coding was problem .

Really need help from yrs...
Cheers and Thanks much !!
Arhun