473,378 Members | 1,330 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,378 software developers and data experts.

roll over

i am trying to add a very simple roll over for my website. when the pages
load most of the images load but there are a couple that don't. if i roll my
mouse over the images that don't come up, they will appear. does anyone have
any suggestions? i checked my image size and it's ok.

thanks!

~kim
Jul 20 '05 #1
11 2383
Lee
HVTN Recruitment said:

i am trying to add a very simple roll over for my website. when the pages
load most of the images load but there are a couple that don't. if i roll my
mouse over the images that don't come up, they will appear. does anyone have
any suggestions? i checked my image size and it's ok.


You've mistyped the names in the src attribute of the image tags.
Maybe because your SHIFT key isn't working.

Jul 20 '05 #2
> >i am trying to add a very simple roll over for my website. when the pages
load most of the images load but there are a couple that don't. if i roll my
mouse over the images that don't come up, they will appear. does anyone have
any suggestions? i checked my image size and it's ok.


You've mistyped the names in the src attribute of the image tags.
Maybe because your SHIFT key isn't working.


Too legit to shift.

Jul 20 '05 #3
Hi Douglas, thanks for your reply. I'm new at this so could you please
explain your answer?

I checked the spelling and couldn't find anything.

This is the source:

<script language="javascript">
<!--

if (document.images) {

// On images

image1on = new Image();
image1on.src="images/home-on.gif";

image2on = new Image();
image2on.src="images/volunteer-on.gif";

image3on = new Image();
image3on.src="images/faq-on.gif";

image4on = new Image();
image4on.src="images/trials-on.gif";

image5on = new Image();
image5on.src="images/safety-on.gif";

image6on = new Image();
image6on.src="images/community-on.gif";

image7on = new Image();
image7on.src="images/staff-on.gif";

image8on = new Image();
image8on.src="images/links-on.gif";

image9on = new Image();
image9on.src="images/contacts-on.gif";
// Off images

image1off = new Image();
image1off.src="images/home-off.gif";

image2off = new Image();
image2off.src="images/volunteer-off.gif";

image3off = new Image();
image3off.src="images/faq-off.gif";

image4off = new Image();
image4off.src="images/trials-off.gif";

image5off = new Image();
image5off.src="images/safety-off.gif";

image6off = new Image();
image6off.src="images/community-off.gif";

image7off = new Image();
image7off.src="images/staff-off.gif";

image8off = new Image();
image8off.src="images/links-off.gif";

image9off = new Image();
image9off.src="images/contacts-off.gif";
}

function imgOn (imgName) {
if (document.images) {
document [imgName].src = eval(imgName + "on.src");
}
}
function imgOff(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "off.src");
}
}
// -->

</script>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4
Kim Louis wrote on 24 sep 2003 in comp.lang.javascript:
document[imgName].src = eval(imgName + "off.src");


Why the eval ?

document[imgName].src = imgName + "off.src";

===

Special taskforce against the senseless proliferation of the evil eval.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #5
Lee
Kim Louis said:

Hi Douglas, thanks for your reply. I'm new at this so could you please
explain your answer?

I checked the spelling and couldn't find anything.

This is the source:


The error is probably in your HTML, not the JavaScript.

Jul 20 '05 #6
> I'm new at this
function imgOn (imgName) {
if (document.images) {
document [imgName].src = eval(imgName + "on.src");
}
}


Who taught you to do this? Who told you to misuse the eval() function that way?
I want to know.

People who are new at this should never use eval(). Never. But you should get in
the habit of making your code more readable. It is hard to make it right if it
is hard to look at.

function imgOn(imgName) {
if (document.images) {
document[imgName].src = imgName + "on.src";
}
}

http://www.crockford.com/javascript/survey.html

Jul 20 '05 #7
hmm? i'm not sure why the eval is in there but if i take it out, none of
my images load...

any more suggestions?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #8

Thanks! I checked and checked my html but still can't find anything.
Would it be bad to post it to see if you can find something wrong?
Please forgive me if this is not appropriate.

<body bgcolor="#ffffff" text="#000000" link="#cc0000" alink="#66cc00"
vlink="#cc3333">
<table summary="This table contains links to the HVTN" cellpadding="1"
cellspacing="4" border="0" width="406">
<tr valign="center">
<td width="130" align="left">
<a accesskey="b" href="http://www.hvtn.org/">

<img src="images/hvtn.jpg" border="0" alt="HIV Vaccine Trials Network"
LONGDESC="http://www.hvtn.org/" width="130" height="82"></a>
</td>

<td width="360"><center>
<img src="images/hvtu.gif" border="0" alt="HIV Vaccine Trials Unit
Seattle, Washington"
LONGDESC="Welcome to the Fred Hutch HIV Vaccine Trials Unit"
width="360" height="127"></center>
</td>
<td width="150" align="right"><a accesskey="c"
href="http://www.fhcrc.org/">
<img src="images/fhcrc.gif" width="118" height="65"
border="0" alt="Fred Hutchinson Cancer Research Center"
LONGDESC="http://www.fhcrc.org/"></a>

<a href="http://www.washington.edu">
<img src="images/uw.gif" width="150" height="36"
border="0" alt="University of Washington"
LONGDESC="http://www.washington.edu/"></a></td>
</tr></table>

<hr width=100% size="4" color="#000000">

<table summary="This table contains links to other pages with in this
site"
cellpadding="1" cellspacing="0" border="0" width="630" >
<tr valign="top" align="left">
<td width="115" background="images/bg.gif" width="115" height="189">

&nbsp;

<a accesskey="d" href="volunteering.htm"
onMouseOver = "imgOn('image2')"
onMouseOut = "imgOff('image2')">
<img name="image2" src="images/volunteer-off.gif" border="0"
alt="Volunteering" LONGDESC="Link to how to volunteer for a HIV vaccine
trial"
width="115" height="21"></a>
<a accesskey="i" href="faq.htm"
onMouseOver = "imgOn('image3')"
onMouseOut = "imgOff('image3')">
<img name="image3" src="images/faq.gif-off" border="0"
alt="FAQs" LONGDESC="Link to list of frequently asked questions about
HIV vaccine trials"
width="115" height="21"></a>

<a accesskey="y" href="trials.htm"
onMouseOver = "imgOn('image4')"
onMouseOut = "imgOff('image4')">
<img name="image4" src="images/trials-off.gif" border="0" width="115"
height="21"
alt="Trials" LONGDESC="Link to information about our trials"></a>
<a accesskey="k" href="safety.htm"
onMouseOver = "imgOn('image5')"
onMouseOut = "imgOff('image5')">
<img name="image5" src="images/safety-off.gif" border="0" width="115"
height="21"
alt="Safety and Ethics page" LONGDESC="Link to information about safety
and ethics"></a>
<a accesskey="l" href="community.htm"
onMouseOver = "imgOn('image6')"
onMouseOut = "imgOff('image6')">
<img name="image6" src="images/community-off.gif" border="0"
alt="Community Education" LONGDESC="link to a description about our
Community Education"
width="115" height="21"></a>


<a accesskey="n" href="staff.htm"
onMouseOver = "imgOn('image7')"
onMouseOut = "imgOff('image7')">
<img name="image7" src="images/staff-off.gif" border="0" width="115"
height="21"
alt="Staff" LONGDESC="Link to a list of our staff"></a>
<a accesskey="o" href="Links.htm"
onMouseOver = "imgOn('image8')"
onMouseOut = "imgOff('image8')">
<img name="image8" src="images/links-off.gif" border="0" width="115"
height="21"
alt="Web Resources" LONGDESC="Link to other sites regarding HIV and
vaccines"></a>

<a accesskey="p" href="contacts.htm"
onMouseOver = "imgOn('image9')"
onMouseOut = "imgOff('image9')">
<img name="image9" src="images/contacts.gif" border="0" width="115"
height="21"
alt="Contact Information" LONGDESC="Link to how to contact the
HVTU"></a>
<p>

<br>

<br>

</td>
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #9
Kim Louis wrote on 24 sep 2003 in comp.lang.javascript:
hmm? i'm not sure why the eval is in there but if i take it out, none of
my images load...

any more suggestions?


should not.

show us the code.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #10
"Douglas Crockford" <no****@laserlink.net> writes:
People who are new at this should never use eval(). Never. But you
should get in the habit of making your code more readable. It is
hard to make it right if it is hard to look at.
Except that this doesn't work.

function imgOn(imgName) {
if (document.images) {
document[imgName].src = imgName + "on.src";
Should be:
document[imgName].src = window[imgName + "on"].src; }
}


/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #11
Lee
Kim Louis said:


Thanks! I checked and checked my html but still can't find anything.
Would it be bad to post it to see if you can find something wrong?
Please forgive me if this is not appropriate


Here's one example of a mistyped src:
<img name="image3" src="images/faq.gif-off" border="0"

Jul 20 '05 #12

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

Similar topics

4
by: Kenny | last post by:
I have been trying to write a script that will increase the size of and image when you mouse over it, and decrease it to original size, when you mouse out. After a couple of attempts, this is what...
2
by: Marcus | last post by:
I am after what is probably very basic help. Below is the HTML including the bit of Java I am trying to understand why its not working. The idea is as the mouse moves over and off the "button"...
6
by: Leythos | last post by:
I have a site at http://www.bhlnet.net/opep, it's template site for testing, it uses roll-over images that are setup/controlled by javascript. I've just noticed that the pages seem to be stuck with...
5
by: Abhishek Srivastava | last post by:
Hello All, I am very new to DB2. I am studying the feasibility of porting my appliction to DB2. Our appliction keeps 45 days of data. the data for the 46th day is to be purged. Currently...
10
by: pozz | last post by:
Hi all, I need to write a simple incrementing/decrementing function like this: unsigned char change( unsigned char x, unsigned char min, unsigned char max, signed char d); x is the value...
0
by: botenremko | last post by:
Hi all! I am searching for a css or javascript with which I can perform the roll-over-and-click-to-hold functionality as can be seen in the main navigation menu of www.watersport-bank.nl. ...
1
by: ColorWorld | last post by:
Hi there I am setting up a menu. It is an "button" with roll over function. The background image changes. That works fine :) But: underneath is an image. Each menu item has its own image AND i...
1
by: lenest | last post by:
I need help writing a program.... You are to write a python program to accomplish the following: a.. Play a dice game of Craps using a random number generator to simulate the roll of the...
1
by: kc42 | last post by:
hey there i am new to webdesign. but i'm working on a site and i am trying to make it where when i roll over an image that same image gets larger then when you mouse off the larger image dissapears....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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 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.