SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    100% Windoze-free earther's Avatar
    Join Date
    Feb 2003
    Location
    Linuxland
    Posts
    2,788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reload page when font resized

    Posting in this forum for the first time. JS is very foreign territory for me so please be patient.

    I am using this script to reload NN4 when the window is resized because resizing breaks the CSS page:

    <script type="text/javascript">

    <!--
    function MM_reloadPage(init) { //reloads the window if Nav4 resized
    if (init==true) with (navigator) {if ((appName=="Netscape" )&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
    else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    // -->

    </script>

    I just discoved that resizing the font also breaks the page. Is there a way to modify this script to have it do both or do I need two separate scripts? I did a search but one didn't jump out at me. So apologies if this has been covered before. Thanks.

  2. #2
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know if Javascript can detect font-resizing, are you resizing the font with Javascript, or a netscape selection?
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  3. #3
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm - not too sure about this. An event needs to trigger this - and there is no onfontresize event. For IE you could likely use onpropertychange, but I'm not sure for other browsers. Maybe javascript's watch() method.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  4. #4
    100% Windoze-free earther's Avatar
    Join Date
    Feb 2003
    Location
    Linuxland
    Posts
    2,788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cyborg from dh
    I don't know if Javascript can detect font-resizing, are you resizing the font with Javascript, or a netscape selection?
    I just changed the font in Netscape - view > increase font > decrease font . I finally got a layout that looks good in NN 4x and now this. Can't expect users to know to refresh the page so I want to do it for them. Anyone???

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not just trap the resize event? This is fired every time the user does a font resizing.

    http://www.webreference.com/dhtml/di...ize/index.html

    Now those 11 morons in North Dakota who still use this browser won't get too upset. Thank goodness.
    ::: certified wild guess :::

  6. #6
    100% Windoze-free earther's Avatar
    Join Date
    Feb 2003
    Location
    Linuxland
    Posts
    2,788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by adios
    Why not just trap the resize event? This is fired every time the user does a font resizing.

    http://www.webreference.com/dhtml/di...ize/index.html

    Now those 11 morons in North Dakota who still use this browser won't get too upset. Thank goodness.
    There is already a script in place to reload the PAGE when it is resized but not when the FONT is resized (with the page remaining the same size). How can I get it to reload on a FONT resize?? Or have I missed something in the link that you posted?

    FYI, about 20% or more of my visitors use NN 4 - I can't remember exactly. They are not morons. Many are from poorer countries all over the world who do not have the luxuries that we do in the West and are running older browsers (including NN 2!) because that's all they are able to run.

  7. #7
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Run this in Navigator:

    <html>
    <head>
    </head>
    <body onresize="alert('resize')">
    </body>
    </html>

    Change the font size (ctrl + ]). Anything?

    Not going to get involved in another browser-slug-fest; but that's the highest usage figure - by far - I've seen in ages. What do 'luxuries' have to do with it? I've spent untold hours (months) in recent years working out programming solutions for this bug-laden, virtually unsupported piece of software. Like many people: I'm done.

    http://archive.webstandards.org/wfw/ns0700.html
    ::: certified wild guess :::

  8. #8
    100% Windoze-free earther's Avatar
    Join Date
    Feb 2003
    Location
    Linuxland
    Posts
    2,788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't know whether I did it correctly but it didn't work. Thanks for trying though.


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
  •