Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Add class to navbar

Hi,
I have a navbar button element which is located in the page footer and I have attempted to change the font size by adding a css class and then adding the class using $("sumitbtn").addClass("my-navbar"); this has no effect can you advise me on the correct approach please.

Class:

.my-navbtn {
font-weight:bold;
font-size:24px;
}

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Add class to navbar

Did you test that $("sumitbtn") selects the right element in the DOM?

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Add class to navbar

Hi Max, I also make the element visible and this works! Please see the code below which is taken from the the debugger.

Code: Select all

 $('#j_80 [name="passtxt"]').die().live({ 
         change: function() { 
             var txt = $(this).val(); 
             txt = txt.toUpperCase(); 
             $(this).val(txt); 
             $("sumitbtn").addClass("my-navbar"); 
             Tiggzi('sumitbtn').show('slow'); 
             Tiggzi("sumitbtn").addClass("my-navbar"); 
         }, 
     });
Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Add class to navbar

The html from inspecting the element:

a class="ui-btn ui-btn-inline my-navbar ui-btn-hover-c ui-btn-up-c" name="sumitbtn" rel="nofollow"span class="ui-btn-inner"span class="ui-btn-text"
Submit login details
/span/span/a

span class="ui-btn-inner"span class="ui-btn-text"
Submit login details
/span/span

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Add class to navbar

a class="ui-btn ui-btn-inline my-navbar ui-btn-hover-c ui-btn-up-c" name="sumitbtn" rel="nofollow"span class="ui-btn-inner"span class="ui-btn-text"
Submit login details
/span/span/a

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Add class to navbar

the html

a class="ui-btn ui-btn-inline my-navbar ui-btn-hover-c ui-btn-up-c" name="sumitbtn" rel="nofollow"span class="ui-btn-inner"span class="ui-btn-text"
Submit login details
/span/span/a

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Add class to navbar

Hi Max,

The html screenshot:

Image

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Add class to navbar

The selector that you use select by tag name: http://api.jquery.com/element-selector/. Tiggzi(id) works differently, it search by id: http://docs.tiggzi.com/javascript-api/

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Add class to navbar

Hi Max,

I have tried both methods and also attempted to add the class as an additional property.

Image

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Add class to navbar

Hello! To add class use this code is Tiggzi("sumitbtn").addClass("my-navbar");

Here is CSS rule to change font size

.my-navbtn .ui-btn-inner .ui-btn-text{
font-weight:bold;
font-size:24px;
}

Return to “Issues”