[Javascript] Font size control bar

Laurent Muchacho elmuchacho at gmail.com
Thu Oct 13 09:07:10 CDT 2005


Hi Flavio,

I think if you change the references from document to parent.document you will not make the style change in the opener window but only in the popup !

Barry If you look at the logic of the code you are using you must includes the css files and js file into the window where you like to change the font size because if you includes the css files into the popup and try to enable or disable the one you want you will only make the font changing in the popup window.
If I found 5 min I do the implementation for you.

Laurent
  

----- Original Message ----- 
  From: Flavio Gomes 
  To: [JavaScript List] 
  Sent: Thursday, October 13, 2005 1:50 PM
  Subject: Re: [Javascript] Font size control bar



  You also copied the styleswitcher.js and all the .css files, right?


Original:
================================================================================
function setActiveStyleSheet(title) {
  var i, a, main;
    for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}
=================================================================================

Then you'll have to change all references from document to parent.document.

PS.: Watch out for popup-blockers.

Hope to Help,


-- 
Flavio Gomes
flavio at economisa.com.br

  Barry Conner wrote: 
I've created the following little view control bar which I designed to display in a frames navigation window for my HTML-based application interface.  The frame is generated as a popup to exclude all of the undesirable toolbar & status bar overhead.
 
The actual font manipulation here is handled via a set of JS & CSS files (as posted at http://www.alistapart.com/articles/relafont )
 
HERES THE QUESTION:  This is intended as a mere view control bar, so how might I script the fontsize controls to act on the main frame rather than on itself???
 
Thanks for any thoughts you might have on a solution!
 
Barry
 
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<form name="font_select" action="GET">
     <table align="center" width="100%" location="0" cellspacing="0" cellpadding="4" rules=cols frame=below border="1" margins="0">
          <tr>
               <td width="25%">
                    <strong>
                    View Control:
                    </strong>
               </td>
               <td align="center">
                    <button type="button" onclick="javascript:history.back()"><small>&nbsp;&nbsp;Back&nbsp;&nbsp;</small></button>
               </td>
               <td align="center">
                    <button type="button" onclick="javascript:history.forward()"><small>Forward</small></button>
               </td>
               <td align="center">
                    <button type="button" onclick="javascript:fontsizedown();"
                    value=" font - " />
                    <small>Smaller Font</small></button>
               </td>
               <td align="center">
                    <button type="button" onclick="javascript:fontsizereset()" />
                    <small>&nbsp;Reset Font&nbsp;</small></button>
               </td>
               <td align="center">
                    <button type="button" onclick="javascript:fontsizeup();"
                    value=" font + " />
                    <small>&nbsp;Larger Font&nbsp;</small></button>
               </td>
          </tr>
     </table>
     <hr />
</form>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript
  

------------------------------------------------------------------------------


  _______________________________________________
  Javascript mailing list
  Javascript at LaTech.edu
  https://lists.LaTech.edu/mailman/listinfo/javascript
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20051013/f2e39195/attachment.htm>


More information about the Javascript mailing list