Archives

Archives / 2012
  • Active button in navbar in Jquery Mobile

     

    When you add ui-btn-active class to your anchor, it will activate the selected button in your navbar. Moreover, if you'd like to keep it active when you return to it again, you need to add ui-state-persist.

    jquery mobile framework detects ui-state-persist class, then fires the delegate as following:

     

    $navbar.delegate( "a", "vclick", function( event ) {
    if( !$(event.target).hasClass("ui-disabled") ) {
     $navbtns.not(".ui-state-persist" ).removeClass( $.mobile.activeBtnClass );
      $( this ).addClass( $.mobile.activeBtnClass );
    }
    });
    

  • Calculating GridView Fields Using jquery

    Using jquery library with ASP Controls can be a good practice to handle any client script. Furthermore, using jquery with GridView would be more efficient than using native JavaScript. JavaScript needs a lot of codes, on the other hand, Jquery helps to build robust program with less codes and work.