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

change back gound image

Hello friends,

i have a page with a div tag and a div class(i dont know the perfect terminology ofcourse)


i have two boxes in the page. In the first page i have few anchor links.
My requirement is if i place mouse pointer on one of the links in the first box then the background image of the second box must be changed.

How do i acheive it?



Here is my code


Code:

[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<style>
#left {
width:702px;
height:370px;

border:1px;
margin:0px 0px 0px 170px
}
.leftbox {
width:300px;
height:400px;
padding:5px;
border:1px solid #720B0C;
float:left;


}
.rightbox {
width:300px;
height:400px;
padding:5px;
border:1px solid #720B0C;
float:left;
background: url(images/bg.jpg)

}
</style>

</head>
<body bgcolor=#F7EDD8>


<div id="left">

<div class="leftbox">
<A HREF="http:\\www.yahoo.com"> 1. ABC</a><br><br>
<A HREF="http:\\www.yahoo.com"> 2. 123</a><br><br>
<A HREF="http:\\www.yahoo.com"> 3. XYZ</a><br><br>

</div>
<div class="rightbox"><p>right</p></div>
</div>
</body>
</html>[/HTML]


Thank you
Dec 23 '07 #1
1 1106
acoder
16,027 Expert Mod 8TB
Add the onmouseover to the links either inline <a ... onmouseover=...> or in script tags:
Expand|Select|Wrap|Line Numbers
  1. var links = document.getElementsByTagName("a");
  2. for (i = 0; i < links.length; i++) {
  3.   links[i].onmouseover = ...
  4. }
To change the background image, use the style.backgroundImage property - see link.

Please use code tags when posting code.
Dec 23 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Spike | last post by:
Hello! Im going to make a javascript for changing alot of images. But im not sure how to do it., where to start.. Ok, first.. this is the isue. I have 3 images(I call them 1a-3a). when u...
2
by: Raigo | last post by:
There is a bug with IE6 handling Javascript onMouseOver and onMouseOut events. Can it be replaced somehow with CSS? For example when I want to change images when user moves mouse to certain HTML...
3
by: dataguy | last post by:
I can't find it anywhere in the manual, but I have a developer that wants to know if we can code a trigger to capture the data that has changed in a table only if certain columns have changed. It...
6
by: ruca | last post by:
Hi gurus, I have a imagebutton in my WebForm, and I want that when I click (mouse down) on her the imagebutton change image and when I "unclick" (mouse up) change to the original image. Basically...
1
by: Phil_Cam | last post by:
Hello All On a webpage I have a standard paypal image button for purchases. I am trying to set it up so that it only shows up or is endabled when text is entered into a textbox and a button is...
2
by: eholz1 | last post by:
Hello PHP Group, I have a php page that calls another php page to load a image from a database (mysql) in to the calling page. It works like this: first_view.php has <img src="image.php?img=5"...
14
by: windandwaves | last post by:
Hi Folk and Gurus This may help some of you (though probably not the gurus), in changing images: http://www.sunnysideup.co.nz/j/imageChange/ Any feedback appreciated. Cheers
5
by: rosaryshop | last post by:
I'm working a jewelry/rosary design web site at http://www.rosaryshop.com/rosariesAndKits2.php. As the user makes selections, it updates images of various parts, giving them a preview of the...
3
by: adamjblakey | last post by:
Hi, I want to convert this into a function. How would i go about doing this? $path_thumbs = "images/thumbs"; $path_big = "images/big"; //the new width of the resized image....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
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: 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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.