Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Layer as static

  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Location
    Chicago, Illinois
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 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
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    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...

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    1,137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

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