Tag Archives: AjaxControlToolkit

I used the code from Matt Berseth to create navigation buttons to change the selected tabs, but as I was using the tabs in a Left frame in the Web application; I did not have enough space to display all the tabs headers, the navigation buttons was working fine but the headers was invisible, so I changed the code to add a horizontal scrolling for the Header. I am creating dynamic tabs so I do not know the required value of the scroll as I do not know the width of the headers, and so I am using (_header.offsetWidth) for the active tab as a scroll value

I wanted to use the wheel mouse button to slide the slider up or down to use it in a Mapping application for Zoom In/Out, I used a java script function to detect the wheel mouse on the Map, I wanted the Zoom function to start when the user release the wheel mouse so I added a timer to detect that the user stopped using the wheel button

var hTimer = null;

function wheelZoom(e)

{

try

{

e = e ? e : window.event;

var raw = e.detail ? e.detail : e.wheelDelta;

var normal = e.detail ? e.detail * -1 : e.wheelDelta / 40;

if (normal > 0)

{

var slider = $find(“Slider2”);

if (slider != null)

{

slider.set_Value(slider.get_Value()-1);

}

else

{

}

}

elseif(normal < 0)

{

var slider = $find(“Slider2”);

if (slider != null)

{

slider.set_Value(slider.get_Value()+1);

}

else

{

}

}

if (hTimer != null)

{

window.clearTimeout(hTimer)

}

else

{

}

hTimer = window.setTimeout(doZoomWheel, 500)

cancelEvent(e);

}

catch(err)

{

alert(err.message)

}

finally

{

}

}

In the above code the slider will response to the wheel mouse but the Zoom function will be called only when the user stop using the wheel button