Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-14-2002, 10:06 AM   PM User | #1
xNuclearRabbitx
New to the CF scene

 
Join Date: Jun 2002
Location: Chicago, Illinois
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
xNuclearRabbitx is an unknown quantity at this point
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
xNuclearRabbitx is offline   Reply With Quote
Old 06-14-2002, 05:30 PM   PM User | #2
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
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
jkd is offline   Reply With Quote
Old 06-14-2002, 10:33 PM   PM User | #3
scroots
Senior Coder

 
Join Date: Jun 2002
Location: UK
Posts: 1,137
Thanks: 0
Thanked 0 Times in 0 Posts
scroots is an unknown quantity at this point
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
scroots is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:00 AM.


Advertisement
Log in to turn off these ads.