Web Analytics Made Easy -
StatCounter How can I explain this...? - CodingForum

Announcement

Collapse
No announcement yet.

How can I explain this...?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I explain this...?

    The idea:

    When the <BODY> of index.html is in focus (<BODY onFocus="...), I need to "light(this)" to a <DIV>.

    When <BODY> of index.html is in blur (<BODY onBlur="...), I need "dark(this)" to a <DIV>.

    How do I assign this effect from the BODY to the DIV?

    Also, there is an iFRAME in the page. I need to make sure if someone clicks on the iFRAME, the index.html will still be in focus. I'm thinking if you click on the iFRAME it will set focus to itself and blur the index.html...

    Can someone help me on this?

    Quيet Storm Designs ~ Art is not what you see, but what you make others see.
    · the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·

  • #2
    window.onfocus = function() {
    dark(document.getElementById(divId));
    }

    window.onblur = function() {
    dark(document.getElementById(divId));
    }

    i don't know what to tell you about the iframe. you'll have to play with it first, and see.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

    Comment


    • #3
      I think I'm not quite getting it:

      <SCRIPT>
      window.onfocus = function() {
      light(document.getElementById(mist));
      }
      window.onblur = function() {
      dark(document.getElementById(mist));
      }
      </SCRIPT>

      <DIV ID="mist" STYLE="background-color:#000000; width:100%; height:100%; filter:alpha(Opacity=0);position: absolute; bottom: 0px; left: 0px; z-index:1;">
      &nbsp;
      </DIV>

      Like that?
      Quيet Storm Designs ~ Art is not what you see, but what you make others see.
      · the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·

      Comment


      • #4
        hey, QS...

        Gotta pass that id as a string; unless you're using light() & dark() elsewhere, might as well incorporate the whole thing:
        Code:
        onfocus = function() {
        var el; 
        if (typeof document.all != 'undefined') el = document.all('mist'); 
        else if (typeof document.getElementById != 'undefined') el = document.getElementById('mist'); 
        if (el) el.style.[i]whatever[/i] = [i]whatever[/i];
        }
        
        onblur = function() { 
        var el; 
        if (typeof document.all != 'undefined') el = document.all('mist'); 
        else if (typeof document.getElementById != 'undefined') el = document.getElementById('mist'); 
        if (el) el.style.[i]whatever[/i] = [i]whatever[/i];
        }
        You're correct about the <iframe>; a number of things can fire a blur event on the window object even while its document content retains focus. Sometimes better to identify these bugs as they occur...

        Comment


        • #5
          I got it. I played around with several different options and these are the basics:

          Code:
          <DIV ID="mist" 
           STYLE="filter:alpha(Opacity=0); 
               background-color:#000000; 
               width:100%; 
               height:100%; 
               position: absolute; 
               bottom: 0px; 
               left: 0px; 
               z-index:2;" 
               onFocus="dark(mist);" 
               onBlur="light(mist);" >
          &amp;nbsp;
          </DIV>
          I also have to have the onFocus and onBlur events in the body:
          Code:
          <BODY 
          BGCOLOR="tan" 
           MARGINWIDTH="0" 
            MARGINHEIGHT="0" 
             LEFTMARGIN="0" 
              RIGHTMARGIN="0" 
               BOTTOMARGIN="0" 
                TOPMARGIN="0" 
           onLoad="
            this.focus(); 
             window.status='Springfield DX - v6.0'; 
              blurLinks();"
           onselectstart="return false" 
           onselect="return false"
           onFocus="dark(mist);" 
           onBlur="light(mist);">
          It seems to work with just that.. suprised the code outta me!
          Quيet Storm Designs ~ Art is not what you see, but what you make others see.
          · the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·

          Comment

          Working...
          X