473,513 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mouseover on all browsers

I can't make out why this won't work in iexplorer (even when I change
'Netscape'). The mouse over works fine in >Netscape 4 and Opera 5 and
7. Is it a simple fix or is that wishful thinking?

Regards
N

etc
</HEAD>

<script language="JavaScript">
<!--
function bboatssw_exchange_src(name, rpath, nsdoc)
{
str = (navigator.appName == 'Netscape') ? nsdoc+'.'+name :
'document.all.'+name;
img = eval(str);
if (img) {
if (img.altsrc == null) {
img.altsrc = img.src;
img.src = rpath;
} else {
var temp = img.src;
img.src = img.altsrc;
img.altsrc = temp;
}
}
}

function bboatssw_preload_img()
{
var img_list = bboatssw_preload_img.arguments;
if (document.preloadlist == null)
document.preloadlist = new Array();
var top = document.preloadlist.length;
for (var i=0; i < img_list.length; i++) {
document.preloadlist[top+i] = new Image;
document.preloadlist[top+i].src = img_list[i];
}
}

//-->
</script>

<BODY bgColor=#000000 leftMargin=0 topMargin=0 marginheight="0"
marginwidth="0" text="#f7e6eb" link=#dbcae6
vLink=#cbb0db aLink=#cccae6>
<TABLE border=0 cellPadding=0 cellSpacing=0>

<TR>
<TD width="138"><IMG height=189 src="pieces/one.jpg"
width=138></TD>
<TD width="586" valign="top"><IMG height=189 src="pieces/two2.jpg"
width=611></TD>
</TR>
<TR>
<TD vAlign=top width="138" height="414"> <IMG height=46
src="pieces/three.jpg" width=138>
<A onmouseover="bboatssw_exchange_src('image1', 'pieces/fourover.jpg',
'document')" onmouseout
="bboatssw_exchange_src('image1', 'pieces/fourover.jpg', 'document')"
href="bullshit1.html" ><IMG height=47
alt=four.jpg src="pieces/four.jpg" width=138 border=0
name=image1></A>

ETC ETC
Jul 20 '05 #1
3 1667
ni*****@hotmail.com (Nick) writes:
I can't make out why this won't work
What doesn't work? Does nothing happen or does the wrong thing happen?
in iexplorer (even when I change 'Netscape'). The mouse over works
fine in >Netscape 4 and Opera 5 and 7. Is it a simple fix or is that
wishful thinking? <script language="JavaScript">
The type attribute is required in HTML 4.0+
<script type="text/javascript">
<!--
HTML comments are not needed in Javascript.
function bboatssw_exchange_src(name, rpath, nsdoc)
{ str = (navigator.appName == 'Netscape') ? nsdoc+'.'+name :
'document.all.'+name;
img = eval(str);


Declare your variables as local to avoid polluting the global
namespace.

You never need eval to access object properties or variables.

These two lines can be changed to just:
var img = document.images[name];

It works in pretty much any browser later than Netscape 2.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
Lasse Reichstein Nielsen <lr*@hotpop.com> wrote in message news:<n0**********@hotpop.com>...
ni*****@hotmail.com (Nick) writes:
I can't make out why this won't work


What doesn't work? Does nothing happen or does the wrong thing happen?

Thanks for replying. "Doesn't work" in this context means that
images do not even appear - just the cyber box where they should
(either mouse over or not)- in IE, where as everything is normal in
the other browsers (ie the images, differing shades, alternate on
mouseover off movement)work as expected.
Thanks again for your input
N
Jul 20 '05 #3
Additionally replaced the two lines with the one you suggested. The
good news is it still works as before. The bad news but still not in
IE (v5.5). No images anywhere (even the ones that don't involve a
mousever. Maybe that's a clue. Does it require a different type of
dir path to the images?).

Regards
N
Jul 20 '05 #4

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

Similar topics

6
11313
by: Fredrik Celin | last post by:
If I add an event (to a div for example) with js, it replaces the event if there already is one. How can I add instead of replace this? Example: <body onLoad="testDiv.onmouseover = (function(event){alert('helloAgain')});"> <div id="testDiv" onMouseOver="alert('hello');">JaJa!</div>
8
5482
by: OysterCracker | last post by:
Hi - I've previously used js to swap images on mouseover in a menu. I'm stumped on a different situation and would appreciate some advice. I would like to swap imageA to ImageB when I mouseover imageC. Also, swap imageA to ImageB when I mouseover a text link. How do I do those? Thanks, ~OC~
2
2255
by: John J | last post by:
Hi there I have the following code on a site that works as it should but I'd like to understand how it works (a luxury I realise :). I use it to change the colour of buttons on a menu when a mouse goes on and off them as well as pre loading the 2nd images used to show the new button colours. It all looks incredibly complicated and try...
14
2316
by: J. Makela | last post by:
Hallo. This should be a pretty entertaining question for you *real* javascript writers.. I, being the lowly photoshop guy at an ad agency made the mistake of actually saying "HTML" in a conversation once.. and now I have been tasked with building a big website with LOTS of fancy javascripting. Image rollovers mostly. Only problem is that I...
18
14930
by: Jeremy | last post by:
Can anyone point me to where I might find a simple example of coding to achieve the effect of a table row changing colour as the mouse moves over it? Presume the same effect may be possible for an individual table cell? Thanks for any pointers. -- jeremy
2
400
by: Casey | last post by:
Greetings, I have an ASP .NET page that contains three images which give the appearance of a tabbed folder. The images contain the words Product Search, Cart, and Summary respectively. The idea is that when the user is on the Product Search page, an image is displayed to give the appearance that the tab is selected. The user can mouse...
3
19491
by: Annette Acquaire | last post by:
I have and image map with a dozen hotspot links on it that I'm trying to get to open a new image over existing one on mouseover of each COORD. The only thing I was able to do was swap image on mouseover entire image, I want it on each hotspot only, so an image pertaining to each link shows up. I have done it in JavaScript, but the website I'm...
10
2664
by: jjamjatra | last post by:
I am struggling with a event model handling problem in Javascript that shows up only in Firefox. I have 2 little websites I'd like you to take a look at: http://gis.cbmiweb.com/MexicoExported/default.asp http://gis.cbmiweb.com/MDWmaps/default.asp The issue involves the code behind the "Zoom Box"...
0
7269
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7177
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7394
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7559
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7123
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7542
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5701
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.