chage back ground image of div class

Discussion in 'HTML & Website Design' started by ravindarjobs, Dec 23, 2007.

  1. #1
    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:

    <!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>


    Thank you
     
    ravindarjobs, Dec 23, 2007 IP
  2. minus19

    minus19 Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can do that with CSS but it's complicated and pretty messy. I think you're going to need to use JAVA or AJAX. Unless i've misunderstood.
     
    minus19, Dec 23, 2007 IP
  3. ravindarjobs

    ravindarjobs Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    indeed my requirement is just to show an image right side when mouse is placed on the link. I am using div because i thought they are best. But if there is any way other than the div's let me know.
    My requirement is just to show an image right side.


    thank you
     
    ravindarjobs, Dec 23, 2007 IP
  4. HDaddy

    HDaddy Active Member

    Messages:
    287
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
  5. minus19

    minus19 Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yeah, follow HDaddys link thats what you need, sorry i cant be more helpfull but i'm re-installing Vista on my workstation :(
     
    minus19, Dec 23, 2007 IP
  6. ravindarjobs

    ravindarjobs Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Many thanks friends,

    That link has given me good solution and an easy one.

    thank you
     
    ravindarjobs, Dec 23, 2007 IP