views:

132

answers:

1

Consider the following code.

It's an anchor tag with an id called leader-module-total that - when pressed - calls a PHP script and displays the echos done in the PHP code inside an id called leader-module.

Basic enough.

However, each time I do this, I need to "shrink" it using the last piece of code in this snippet.

My question is, how come? Am I doing something wrong here?

$('#leader-module-total').click(function() {

   //load an image to show while processing
   $('#leader-module').html( '<div class="ajaxLoader"></div>' );

   //process the php script -- btw, is this valid i.e. calling it using / 
   //and not fully qualified with http://mydomain/page-to-be-called  
   $.get('/ajax-leader-module-response.php', { timeframe: 'total' }, 
       function(data){
          $('#leader-module').html( data );
       }
   );

   //this is my question: why is this necessary???  
   //I need to make it smaller than it was for it to display normally.
   $('#leader-module').css('font-size', '0.9333em');
   return false;
});
A: 

I think it is inheriting styles from the parent tag. Please check the parent elements for any font size style.

rahul
Yes. It did.I didn't know jQuery .html() re-executed the parent tag when replacing the data in it. At least that's how it comes out in all major browsers.Thanks a lot for the help.
adergaard