Tuesday, January 27, 2015

How to do auto higlight navigation and font size by jquery ?

    Please mak a js file and put on your master page.
     $(document).ready(function () {
         $('#lnkIncfont').click(function () {
             curSize = parseInt($('#container').css('font-size')) + 3;
             if (curSize <= 25) {
                 $('#content').css('font-size', curSize);
             }
         });
         $('#lnkActfont').click(function () {
             curSize = parseInt($('#container').css('font-size'));
             $('#content').css('font-size', curSize);
         });

         $('#lnkDecfont').click(function () {
             curSize = parseInt($('#container').css('font-size')) - 3;
             if (curSize >= 8) {
                 $('#content').css('font-size', curSize);
             }
         });
     });


 $(document).ready(function () {
         var location = window.location;      
         $('.navlink').children('ul').children('li').children('a').each(function () {          
             if (location == this.href) {              
                 $(this).parent('li').addClass('active');
             }
         });
     });

No comments:

Post a Comment