Advanced Search

Results 1 to 3 of 3

Thread: How to use TEXT SIZER on a web page containing frames?

  1. #1
    Join Date
    Oct 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default How to use TEXT SIZER on a web page containing frames?

    1) Script Title: Text Sizer

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex9/textsizer.htm

    3) Describe problem: Hi! I am designing a webpage with Frames
    (mainFrame + bottom frame). The actual text is mostly in the
    mainFrame of my page. I wish to place the text-sizer control (<a href="javascript:ts('body',1)"> + Larger Font</a> | <a href="javascript:ts('body',-1)">+ Smaller Font</a>) in the
    bottom Frame. Can you please tell me how I can use your script
    textsizer.js for re-sizing the text in the mainFrame?
    I want the text-sizer "target" to be the "mainFrame".
    Thanks in advance.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,681
    Thanks
    43
    Thanked 3,127 Times in 3,093 Posts
    Blog Entries
    12

    Default

    Generally what you do in a case like that is to put the script on the page in the mainFrame.

    Now frames on a page are counted from 0 to however many there are, or you can use their names (if they have names) to access them as well. The frameset page is the parent of the pages in its frames.

    So to access the script on the page in the mainFrame, you could put something like this on a page in the other frame:

    Code:
    <a href="#" onclick="parent.frames[0].ts('body',1); return false;"> + Larger Font</a> | <a href="#" onclick="parent.frames[0].ts('body',-1); return false;">+ Smaller Font</a>
    One caveat though, all three pages (frameset, main, and bottom) must be on the same domain.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    student (10-15-2009)

  4. #3
    Join Date
    Oct 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Thanks jscheuer1

    Hi jscheuer1! Thanks a ton! Yeah, it works fine
    in fireFox 3.0.14, IE 8 & NetScape 9 too!
    Yippeeeeeeeeeeee!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •