Results 1 to 3 of 3

Thread: Document Text Sizer

  1. #1
    Join Date
    Apr 2008
    Posts
    109
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Document Text Sizer

    Script Title: Document Text Sizer

    Script URL (on DD): Document Text Sizer

    Describe problem: I am using this nice little javascript on my website to allow users to resize the text on my webpages.

    I have it working perfectly, and with no problems, but I am looking to add more tags to the javascript.

    The two CSS buttons that controls the increase and decrease of the text size looks like this:
    Code:
    <a href="javascript:ts('textarea',-1)" class="decrease"></a>
    <a href="javascript:ts('textarea',1)" class="increase"></a>
    That makes the javascript resize all text within the
    Code:
    <div id="textarea">
    container.

    I would like to add another Div ID to the increase/decrease buttons, though, so that the text in my
    Code:
    <div id="footer">
    , which is outside the
    Code:
    <div id="textarea">
    , will also have its text increased/decreased.

    I have tried putting in the footer this way;
    Code:
    <a href="javascript:ts('textarea','footer',-1)" class="decrease">
    , but that didn't work.

    How do I do this?


    Cheers,
    Bassa

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Have you tried on just adding highlighted instead:
    Code:
    <a href="javascript:ts('textarea',-1);ts('footer',-1)" class="decrease"></a>
    <a href="javascript:ts('textarea',1);ts('footer',1)" class="increase"></a>
    Also, you should use onclick instead of the (deprecated) pseudo-url:
    Code:
    <a href="#" onclick="ts('textarea',-1);ts('footer',-1);return false;" class="decrease"></a>
    <a href="#" onclick="ts('textarea',1);ts('footer',1);return false;" class="increase"></a>
    Hope that helps.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Apr 2008
    Posts
    109
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Thanks Rangana, that actually worked. However, it seems to work sporadically.

    For instance, if I re-load the webpage, and click on the 'Lille Tekst' (which means 'Smaller Text' in my language), the textarea and the footer gets resized down one step.

    But if I then click on the text increase button ('Stor Tekst'), only the footer gets bigger, and the textarea doesn't react to the click.

    Any ideas?

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
  •