Tuesday, January 14, 2014

// // Leave a Comment

How to find Dimension of an array C-Sharp

How to find Dimension of an array C-Sharp Rank Property is used to find the dimensions of an array class SampleArray { static void Main() { // Declare and initialize an array:  int[,] Sample = new int[5, 10]; System.Console.WriteLine("{0} dimensions.", Sample .Rank); } } // Output: 2 dimensions...
Read More
// // Leave a Comment

Toggle Two Classes in Jquery - Best way

 Toggle Two Classes in Jquery - Best way $("#TriggerElement").toggle(function() { $('#TargerElement').removeClass("FirstClass").addClass("SecondClass"); }, function() { $('#TargerElement').removeClass("SecondClass").addClass("FirstClass"); }); $('#TriggerElement').click(function(){ $('#TargerElement').toggleClass('FirstClass','SecondClass'); });...
Read More

Wednesday, January 8, 2014

// // Leave a Comment

Limit characters in textbox textarea with counter

Bind Text Counter function TextCounter (CountLimit, Elem, CounterElem) { var elem = $("#" + Elem);var Counterelem = $("#" + CounterElem); elem.bind("keyup focus", function () { setCount(elem[0], Counterelem,CountLimit); }); setCount(elem[0], Counterelem,CountLimit); } function setCount (src, elem,limit) { var chars = src.value.length; if (chars > limit) { src.value = src.value.substr(0, limit); ...
Read More
// // Leave a Comment

Allow only numeric in text box jquery

Use the following code for allowing only numbers while entering in text box var Elem=$("#"+ElemId); Elem.on('input propertychange', function () { Elem.val(Elem.val().replace(/[^0-9]/g, '')); });...
Read More
// // Leave a Comment

Javascript Keycode for Chrome,Mozilla Firefox,Internet Explorer

Javascript Keycode for Chrome,Mozilla Firefox,Internet Explorer ommon key codes that are relatively safe to use across browsers are shown in black. Key codes that differ across browsers are shown in red. Do not use this table for character codes of keypress events:keypress character codes are not key-specific and may be enirely different fromkeydown/keyup key codes. Opera MSIE Firefox Safari...
Read More
// // Leave a Comment

10 useful libraries for JavaScript developers

10 useful libraries for JavaScript developers Here I highlight ten tools that you can use to enhance your users' experience on your website. Hammer.js Probably one of the lightest JavaScript libraries around, hammer.js weighs at only 2KB. The library offers touch support for touch devices. The library allows a developer to add tap, double tap, drag, hold and transform actions. In addition, hammer.js can be bound to an...
Read More