c# - ASP.NET NumericUpDownExtender with button hold support? -


hi trying "updown" button allows user hold increment/decrement button , increment/decrement decimal value. have been trying using ajaxtoolkit:numericupdownextender seems allow increment/decrement button clicks. rather clunky since value percentage. ideas of better way handle within asp.net?

i able make pretty javascript using timer. here aspx part of it:

<asp:textbox id="factor" runat="server" maxlength="6" width="60"/> <input id ="upbutton" value="&#9650;" type="button" onmousedown="timerid = setinterval(function(){factup()},100);" onmouseup="clearinterval(timerid);"/>  <input id ="downbutton" value="&#9660;" type="button" onmousedown="timerid = setinterval(function(){factdown()},100);" onmouseup="clearinterval(timerid);"/> 

and javascript:

var timerid = 0; function factdown() {         var obj = document.getelementbyid('factor');         var num = parsefloat(obj.value)         if (isnan(num)) {             return;         }         num -=0.01;         obj.value = num.tofixed(2);                 }      function factup() {         var obj = document.getelementbyid('factor');         var num = parsefloat(obj.value);         if (isnan(num)) {             return;         }         num += 0.01;         obj.value = num.tofixed(2);                 } 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -