Web Analytics Made Easy -
StatCounter Layer as static - CodingForum

Announcement

Collapse
No announcement yet.

Layer as static

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

  • Layer as static

    Hello there. I was just wondering if there is any way to make an entire layer remain static on the screen? I know how to do it with just an image but I need to be able to do it with an entire layer and I haven't been able to figure it out. As always, any help is much apreciated.

    -Nick

  • #2
    For Gecko (NS6+, Mozilla, etc) and Opera 6:

    .static {
    position: fixed;
    left: 5px;
    top: 5px;
    }

    for example.

    For IE, you're going to need to use a setInterval() and some Javascript - I've recently experiemented with the expression() property, but the recalculation engine does not seem to appreciate document.body.scrollLeft and document.body.scrollTop...
    jasonkarldavis.com

    Comment


    • #3
      for internet explorer:


      <span id="staticcombo" style="position:absolute;left:0;top:0;visibility:hidden">
      <P> this is static</P>
      </span>
      <script language="JavaScript1.2">
      var combowidth=''
      var comboheight=''

      function initialize(){
      if (document.all){
      combowidth=staticcombo.offsetWidth
      comboheight=staticcombo.offsetHeight
      setInterval("staticit_ie()",50)
      staticcombo.style.visibility="visible"
      }
      else if (document.layers){
      combowidth=document.staticcombo.document.width
      comboheight=document.staticcombo.document.height
      setInterval("staticit_ns()",50)
      document.staticcombo.visibility="show"
      }
      }

      function staticit_ie(){
      staticcombo.style.pixelLeft=document.body.scrollLeft+document.body.clientWidth-combowidth-30
      staticcombo.style.pixelTop=document.body.scrollTop+document.body.clientHeight-comboheight
      }

      function staticit_ns(){
      document.staticcombo.left=pageXOffset+window.innerWidth-combowidth-30
      document.staticcombo.top=pageYOffset+window.innerHeight-comboheight
      }

      window.onload=initialize
      </script>
      Spammers next time you spam me consider the implications:
      (1) that you will be persuaded by me(in a legitimate mannor)
      (2)It is worthless to you, when i have finished

      Comment

      Working...
      X