Development – Leet 4 Life

Software Development Code Samples and More

Skip to: Content | Sidebar | Footer

Category: jQuery

JQuery Dynamic Height and Width

28 November, 2012 | jQuery | By: Michael Adams

I was working on a few pages where I wanted the content to automatically fill the height/width regardless of browser size. I set my DIV tag with a id of “Content” and then created the following JQuery automatically scale the DIV tag to the appropriate height and width. I only have one DIV tag that required dynamic height and width so I was able to just subtract the height and width of the other elements on the page. Replace N with the height/width of the other elements on the page. The JQuery: JQuery Break down: I use $(window).height() to get [Read More…]

JQuery And ASP.NET Gridview

21 November, 2012 | ASP.NET, jQuery | By: Michael Adams

I was in a situation where I was expanding the functionality of an existing ASP.NET Gridview and I needed to add on-click highlighting and double-click redirecting. I was browsing the JQuery website for a general idea on what to implement when I eventually pieced this together: The JQuery: In the click function I use JQuery to set a class that will change the row background and text color to help the user identify which row was selected. In the dblclick function I use JQuery to look up an id that is stored in a template column in the gridview. That [Read More…]

Firing JavaScript only when inside an ASP.NET Ajax Postback

29 June, 2012 | ASP.NET, C#. NET, jQuery | By: Michael Merrell

There are times where you need to fire a JavaScript event only when you are posting inside of an ASP.NET AJAX post back event. In my example below I am needing to fire a function used for a document ready jQuery event. This event only needs to be fired on AJAX post backs because on normal posts back it will already be handled by jQuery, however it will not be fired when executed inside of an AJAX post back unless told to. The following JavaScript is a pretty standard script for firing a set of functionality when a page has [Read More…]