vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Add-On Releases - Easy Style font resizer (https://vborg.vbsupport.ru/showthread.php?t=217295)

animcentral 06-26-2009 10:00 PM

Easy Style font resizer
 
1 Attachment(s)
The following script can be used to allow visitors to increase or decrease the size of text on your page. This can be useful for visitors who have trouble reading smaller text and allows them to increase it to something they can view more easily.

Template edits:

add the following script in Header
Code:

<script type="text/javascript" language="javascript">
var min=8;
var max=18;
function increaseFontSize() {
  var p = document.getElementsByTagName('div');
  for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
        var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
        var s = 12;
      }
      if(s!=max) {
        s += 1;
      }
      p[i].style.fontSize = s+"px"
  }
}
function decreaseFontSize() {
  var p = document.getElementsByTagName('div');
  for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
        var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
        var s = 12;
      }
      if(s!=min) {
        s -= 1;
      }
      p[i].style.fontSize = s+"px"
  } 
}

</script>

and the following anywhere you wanna show the icons:
Code:

<div>
        <a href="javascript:increaseFontSize();"><img src="font-inc.gif" alt="Increase Font Size" style="border:0px;" /></a>
        <a href="javascript:decreaseFontSize();"><img src="font-dec.gif" alt="Decrease Font Size" style="border:0px;" /></a>
        </div>

Icons:
http://fa.animcentral.com/forums/font-inc.gif http://fa.animcentral.com/forums/font-dec.gif

Demo:
http://fa.animcentral.com/forums/
comment: Persian Language

saviola8x 06-28-2009 12:56 PM

so good.
Thanks

sebil 06-28-2009 01:21 PM

itz nice..

Andyrew 06-28-2009 02:36 PM

It changes back to normal every page load, i find it easier to hold down ctrl then scroll the mouse wheel.

animcentral 06-28-2009 03:58 PM

Quote:

Originally Posted by Andyrew (Post 1838853)
It changes back to normal every page load, i find it easier to hold down ctrl then scroll the mouse wheel.

i will try to make it cookie base in next version

deadlySniper 06-28-2009 03:59 PM

Nice, thanks.

saadessa 06-28-2009 05:20 PM

thank you

Zi55 12-21-2009 12:04 PM

Thanks for this nice mod , we need to see it cookie support in next versions , because when you move to an page , the font return as it default .
Thanks ,
Zi5

Golzarion 02-06-2010 11:26 AM

Nice mod. Although I have always used "Ctrl" and " +" keys for changing the display of the font size... I think it would be more useful if you make it cookie base.

Thank you anyway.

Tanapangarap 06-09-2010 05:35 AM

I hope to see this made cookie-based at one point, too.

Regards,

Kevin


All times are GMT. The time now is 07:11 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01085 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete