473,289 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

fixed layer and IF code for IE

Jaz

Trying to use a fixed layer for a couple of NAV buttons.

I found this code, but the IE part is commented, and I don't
understand the IF statement. It works great on Moz/Firebird and Opera
BUT not IE. Would someone please take a look at this and tell me if it
can made to work in IE? If it can, a hint on the syntax/code would be
much appreciated! PS, this would also get rid of my fixed background.

Thanks in advance
Jaz
------------------------------------------
<style type="text/css">
#fixed
{position:fixed;left:10px;top:100px;width:0px;heig ht:0px;border:0px;background:#330000;color:#330000 ;}
</style>
<!--[if IE]>
<style type="text/css">
#fixed {position:absolute;}
</style>
<script type="text/javascript">
function fixIE(id) {
var elem=document.all[id]; // IE only, so document.all is safe
elem.style.position="absolute"; // "fixed" doesn't work in IE
var
root=document.documentElement?document.documentEle ment:document.body;
var posX=elem.offsetLeft-root.scrollLeft;
var posY=elem.offsetTop-root.scrollTop;
root.onscroll=function() {
elem.style.left = (posX + root.scrollLeft) + "px";
elem.style.top = (posY + root.scrollTop) + "px";
};
}
function initIE(){fixIE("fixed");}
</script>
<![end if] -->
<!--[if IE 6]>
<style type="text/css">
html {
overflow: hidden;
margin:0px;
padding:0px;
}
body {
overflow: auto;
margin: 0px 0px 0px 100px;
padding: 0px 8px;
height:100%;
}
</style>
<script type="text/css">
initIE = undefined;
</script>
<![end if] -->
</head>
<body onload="if (initIE) initIE()">
<div id="fixed">
<table><tr><td>
<a href="index.html"><img src="butn_home.jpg" width=100
height=40 border=0 alt=""></a>
<a href="products.html"><img src="butn_products.jpg" width=100
height=40 border=0 alt=""></a>
<a href="order.html"><img src="butn_order.jpg" width=100
height=40 border=0 alt=""></a>
<a href="contact.html"><img src="butn_contact.jpg" width=100
height=40 border=0 alt=""></a>
<a href="knownby.html"><img src="butn_knownby.jpg" width=100
height=40 border=0 alt=""></a>
</td></tr></table>
</div>

------------------------------------------
(Please excuse the 'burp' when replying)
Jul 20 '05 #1
1 3502
Jaz
Jaz <ha*****@beerburp.com> forgot to take the pills and typed:

Trying to use a fixed layer for a couple of NAV buttons.

I found this code, but the IE part is commented, and I don't
understand the IF statement. It works great on Moz/Firebird and Opera
BUT not IE. Would someone please take a look at this and tell me if it


Um... nevermind... it seems to work fine by itself. I guess it's how I
built it into my own page. I'll keep trying...
(Please excuse the 'burp' when replying)
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Roger Leigh | last post by:
Hello, I'm writing a fixed-precision floating point class, based on the ideas in the example fixed_pt class in the "Practical C++ Programming" book by Steve Oualline (O' Reilly). This uses a...
1
by: PAD | last post by:
I have written a javascript routine that populates a parent document with a series of <iframe>s. Each <iframe> receives its contents from a series of separate smaller HTML files. Of course my NN...
41
by: Richard | last post by:
http://geocities.com/r_bullis/test3.html I've managed to get to this point. Problem is, I get an error saying that an item is not defined as an object. When clicked on, the link should activate...
1
by: Roderik Emmerink | last post by:
Hi, I used a javascript from quirksmode.org to obtain a layer to be fixed (in IE and FF). The black rectangle at: http://www.roderik.net/experiment.htm should be fixed (stay in the same...
2
by: headware | last post by:
I'm relatively new to ASP.NET and ADO.NET, but I have a basic design question regarding the use of web services and APS.NET applications. Right now we have an application that uses web services to...
8
by: Jon Maz | last post by:
Hi, I'm facing a code-optimisation issue on an asp.net/vb.net/SQL Server 2000 project. A web page containing not much more than 3 DropDownLists is taking nigh on 6 seconds to load, because each...
1
by: kraj | last post by:
hi, i need a help in my web page, i used layer in my document in html and i want to set fixed position of that layer in page & if system resolution 800*600 or 1024*768, the layer must be in the...
9
by: SAL | last post by:
Hello, I have a Dataset that I have table adapters in I designed using the designer (DataLayer). I have a business logic layer that immulates the DataLayer which may/may not have additional logic...
0
by: microgolf | last post by:
Hey, i'm new to this group beceaus i have a question i have been trying to solve for a few days now but i just cant figure it out. I am trying to constrain the min-width of my site, but i have...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.