Zombeck.com

You are here: Home » Software » Joomla » K2 Font Resizer Doesn't work on Intro

K2 Font Resizer Doesn't work on Intro

K2, while awesome is complicated and it's got a few things that are annoying. And by annoying I mean the programmers decided what they thought looked good and I don't always agree. Like making the intro text bold. The font enlarger is a cool feature and it helps my 100-year-old godmether build better joomla sites, but it doesn't work on the intro text, so here's how to fix it:

1. Go to your file directory and open the file: /components/com_k2/js/k2.js
2. Look for the Text Resizer section of the code (around line 31) and make this change:

Change this:
// Text Resizer
if ($('fontDecrease')) {
$('fontDecrease').addEvent('click', function(e){
new Event(e).stop();
$$('.itemFullText').removeClass('largerFontSize');
$$('.itemFullText').addClass('smallerFontSize');
});
}
if ($('fontIncrease')) {
$('fontIncrease').addEvent('click', function(e){
new Event(e).stop();
$$('.itemFullText').removeClass('smallerFontSize');
$$('.itemFullText').addClass('largerFontSize');
});
}

To this:
// Text Resizer
if ($('fontDecrease')) {
$('fontDecrease').addEvent('click', function(e){
new Event(e).stop();
$$('.itemIntroText').removeClass('largerFontSize');
$$('.itemFullText').removeClass('largerFontSize');
$$('.itemIntroText').addClass('smallerFontSize');
$$('.itemFullText').addClass('smallerFontSize');
});
}
if ($('fontIncrease')) {
$('fontIncrease').addEvent('click', function(e){
new Event(e).stop();
$$('.itemIntroText').removeClass('smallerFontSize');
$$('.itemFullText').removeClass('smallerFontSize');
$$('.itemIntroText').addClass('largerFontSize');
$$('.itemFullText').addClass('largerFontSize');
});
}

3. Now you can check the frontend to make sure the font resizer works for both the introtext and fulltext.
4. To change the smaller and larger font sizes, open the file: /components/com_k2/css/k2.css
5. Scroll down a bit (or do a code search) and find the classes: .smallerFontSize and .largerFontSize
6. Change these to whatever font sizes suit your needs.

Last modified on Sunday, 29 August 2010 16:35
pic_RZ

Richard Zombeck

I am a blogger, web designer, and technical writer.

My work has been featured in: Huffington Post, The Hill, MSNBC, and Time.

This site is a portfolio of my work and the services I offer.

My Company website can be seen at www.FLADDAP.com

Contact Me:

Us the form at the bottom of the page or e-mail me at

info@zombeck.com

  • 1
  • 2
  • 3
Prev Next

Adding a Retweet Button to your site

Add the following code to you index page Get the official Retweet button to put on...

Print Article is Right Aligned

I noticed when I tried to print an article from one of the contributors at...

K2 Font Resizer Doesn't work on Intro

K2, while awesome is complicated and it's got a few things that are annoying. And...

Adding Plugin Code to an HTML Module

Every time I get a special plugin that can add stuff to content, like ...

Joomla Upload Limit

By default Joomla has an upload limit of 20 MB. A little slim for the...

Changing the Date and Time in Joomla 1.5

By default Joomla shows the date and time in the article. While this is,...

Joomla: Changing Date and Time in Articles

By default the date and time show up in articles as Saturday, 14 November 2009...

Contact Me

Fill out the form below and I'll get back to quickly.
Please fill in all the fields and don't forget the last one with the four digit number.

Don't forget to enter the four digit code in the spam field at the end. If you prefer to email me directly you can reach me at info[AT]zombeck[DOT]com






Join Me

facebook_64x64 linkedin_64x64 twitter_64x64 rss_64x64

Twitter

twitter Bird more info...!

Social Stuff