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 01-22-2005, 07:42 AM   PM User | #1
mythik
New to the CF scene

 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mythik is an unknown quantity at this point
Adding a rollover image to a .js file script

Hi, much thanks to anyone who can help me out here!

.. I am building a gallery website to showcase my photography and illustration. All things are going swimmingly, except now I am stuck!

I am using a js resize script to handle the display of my images on different res settings. It looks wonderful, but I have one image I would like to add a rollover effect to

...is it possible to include something like that in the script shown below? I've been trying to figure out how for the last week, but my grasp on js is not exactly strong

FYI rollover image src=175illustration-hover.png


// JavaScript Document
if (screen.height >= 1024 && screen.width >= 1280) {
document.write("<img src='175illustration.png' border=0>");
}
else {
if (screen.height >= 768 && screen.width >= 1024) {
document.write("<img src='130illustration.png' border=0>");
}
else {
document.write("<img src='90illustration.png' border=0>");
}
}
// End -->
mythik is offline   Reply With Quote
Old 01-22-2005, 02:33 PM   PM User | #2
Mr J
Senior Coder

 
Join Date: Aug 2002
Location: UK
Posts: 2,789
Thanks: 2
Thanked 14 Times in 14 Posts
Mr J is on a distinguished road
you could try

document.write("<img src='175illustration.png' border=0 onmouseover='this.src=\"175illustration-hover.png
\"' onmouseout='this.src=\"175illustration.png\"'>");
__________________
The silent one.

The most dangerous thing in the world is an idea.
The most dangerous person in the world is the one with an idea.
Mr J is offline   Reply With Quote
Old 01-23-2005, 07:47 AM   PM User | #3
mythik
New to the CF scene

 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mythik is an unknown quantity at this point
Thank you so much!

the code worked exactly how i needed it to, now I am officially eternally in your debt!

===Mythik
mythik 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 09:50 PM.


Advertisement
Log in to turn off these ads.