spotlight doesn't work in firefox and chrome... - <html>
-
<head>
-
<title>Your title here</title>
-
-
<style type="text/css">
-
<!--
-
#content{
-
position:absolute;top:0px;left:0px;text-align:center;
-
layer-background-color:#ffffff;background:#ffffff;
-
visibility:hide;visibility:hidden
-
}
-
#light{
-
position:absolute;top:-130px;left:0px;z-index:500
-
}
-
-
</style>
-
-
<script language="JavaScript">
-
-
-
pre=new Image();
-
pre.src="spotlight3.png";
-
n4=(document.layers)?1:0;
-
ie=(document.all)?1:0;
-
d='document.';
-
a=(n4)?'':'all.';
-
s=(n4)?'':'.style';
-
var y,x,c,l,h,w;
-
enough=0;
-
(n4)?window.captureEvents(Event.MOUSEMOVE):0;
-
function Mouse(evnt){
-
if (enough==0){
-
y=(n4)?evnt.pageY-pre.height/2:document.body.scrollTop+event.y-pre.height/2;
-
x=(n4)?evnt.pageX-pre.width/2:document.body.scrollLeft+event.x-pre.width/2;
-
searchlight();
-
}
-
}
-
(n4)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
-
-
function searchlight(){
-
c=eval(d+a+"content"+s);
-
l=(n4)?eval(d+a+"content"+s+"."+d+a+"light"+s):eval(d+a+"light"+s);
-
l.top=y;
-
l.left=x;
-
if (n4){
-
c.clip.top=y;
-
c.clip.right=l.left+pre.width;
-
c.clip.bottom=l.top+pre.height;
-
c.clip.left=x;
-
}
-
else c.clip="rect("+y+","+(x+pre.width)+","+(y+pre.height)+","+x+")";
-
h=(n4)?window.innerHeight:document.body.clientHeight;
-
w=(n4)?window.innerWidth:document.body.clientWidth;
-
c.visibility=(n4)?"show":"visible";
-
c.height=h;
-
c.width=w;
-
}
-
-
function reveal(){
-
l.visibility=(n4)?'hide':'hidden';
-
if (ie)document.body.style.cssText="overflow-x:hidden;overflow-y:scroll";
-
document.bgColor=(n4)?c.bgColor:c.background;
-
enough=1;
-
update();
-
}
-
-
function update(){
-
if (n4){
-
c.clip.top=0;c.clip.right=window.innerWidth;c.clip.bottom=window.innerHeight+window.pageYOffset;c.clip.left=0;
-
}
-
else
-
c.clip="rect(0,"+document.body.clientWidth+","+(document.body.clientHeight+document.body.scrollTop)+",0)";
-
setTimeout('update()',10);
-
}
-
document.write("</head><body bgcolor='#000000'><div id='content'>");
-
//The image map is not necessary but it stops the dotted link line in IE!
-
document.write("<div id='light'><img src="+pre.src+" useMap='#pic' border='0'>"
-
+"<map name='pic'><area shape=CIRCLE coords=65,65,63 href='javascript:reveal()'></map></div>");
-
if (ie) document.body.style.cssText="overflow-x:hidden;overflow-y:hidden";
-
//-->
-
</script>
-
-
-
-
-
<p><font size="4">This is the spotlight effect. Use it on "special"
-
pages, preferably containing only plain text and images. Do not use on complex
-
pages.</font></p>
-
<p><font size="4">Click anywhere on the page to turn the lights on!</font></p>
-
<p><font size="4">This is the spotlight effect. Use it on "special"
-
pages, preferably containing only plain text and images. Do not use on complex
-
pages.</font></p>
-
<p><font size="4">Click anywhere on the page to turn the lights on!</font></p>
-
<p><font size="4">This is the spotlight effect. Use it on "special"
-
pages, preferably containing only plain text and images. Do not use on complex
-
pages.</font></p>
-
<p><font size="4">Click anywhere on the page to turn the lights on!</font></p>
-
<p> </p>
-
-
<p align="center"><img src="http://bytes.com/hallo.gif"></p>
-
-
-
-
-
-
<script language="JavaScript">
-
<!--
-
document.write("</div></body></html>");
-
if (n4||ie)window.onresize=new Function("window.location.reload()");
-
//-->
-
</script>
1 1924
The reason is that you're using very old code which was written for browsers that were first used over 10 years ago.
For starters, this code - n4=(document.layers)?1:0;
-
ie=(document.all)?1:0;
-
d='document.';
-
a=(n4)?'':'all.';
should simply be document.getElementById(...)
I would suggest a rewrite or, if that's not possible, try to bring it up to modern standards by looking at cross-browser code.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Paxton |
last post by:
I created an html email containing a form whose method is POST. The
form is posted to an asp page for processing, but no values are
retrieved. So I response.write all the Request.Form fields, and...
|
by: milkyway |
last post by:
Hello,
I am working with an old Java Script code and have found the following
but after putting in alerts I have found that insertRow doesn't work.
What is the problem?
TIA
function...
|
by: Cliff R. |
last post by:
Hi, I use a handy little Javascript Flash detection script on a number
of sites (copied below). Usually works great, but I just started
trying Firefox and it's not working. A few browsers are...
|
by: niconedz |
last post by:
Hi
The following code works fine in IE but not Firefox.
It's a little script that zooms an image and resizes the window to fit.
Can anybody tell me what's wrong?
Thanks
Nico
== btw.....
|
by: Joe |
last post by:
Hello,
I have created a login page using dotnet. I am using requiredFieldValidator
and noticed that the code works fine in IE but not in Netscape, Opera,
Mozilla, Firefox, etc.
For example...
|
by: bbp |
last post by:
Hello,
In an ASPX page I have a "Quit" button which make a simple redirect in
code-behind.
This button doesn't work no more since (I think) I moved from the framework
1.0 to 1.1
and it doesn't...
|
by: briggs |
last post by:
<html>
<head>
<script>
/* AddChild */
function ac()
{
var c;
var p = document.getElementById("p");
for (var i = 0; i < 5; i++) {
c = document.createElement("DIV"); // Create 'div' element.
|
by: wylbur37 |
last post by:
I'm running an Apache server on my own computer (Windows XP Pro).
I wrote a simple PHP script (called test3.php) that I'm running by
putting the following URL in the address bar of the browser...
|
by: bilibytes |
last post by:
Hi,
i have been creating an ajax aplication on my website and it worked as i expected it to work on Safari and Firefox, until i upgraded to Firefox 3.
It doesn't work either on windows.
the...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |