473,412 Members | 2,003 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,412 software developers and data experts.

2nd rollover grabs first rollover image?

Hi guys and gals, hoping you can help.. I am sure I am missing something simple, but I'm just about ready to throw my computer out the window.

I have a rollover 'a' and a rollover 'b'... my rollover 'b' will only grab the rollover 'a' image.

I'll paste the code below, any help would be greatly appreciated.

Expand|Select|Wrap|Line Numbers
  1. <td bgcolor="#000000"></p>
  2.     <style type="text/css" >
  3. .rollover a {        display : block;
  4.                      width : 800px;
  5.                      height : 124px;
  6.                      background-image:url(http://www.eurovisionimports.com/stockimage1.jpg); }
  7.  
  8. .rollover a:hover {   display : block;
  9.                       width : 800px;
  10.                       height : 429.86px;
  11.                       background-image:url(http://www.eurovisionimports.com/harleyfatrollover.gif); }
  12. </style>
  13. <div class="rollover" > <a href="http://www.eurovisionimports.com/item1.html"></a> </div>
  14. <br />  
  15. </style>
  16. <style type="text/css" >
  17. .rollover b {        display : block;
  18.                      width : 800px;
  19.                      height : 124px;
  20.                      background-image:
  21. url(http://www.eurovisionimports.com/stockimage2.jpg); }
  22.  
  23. .rollover b:hover {   display : block;
  24.                       width : 800px;
  25.                       height : 441px;
  26.                       background-image:url(http://www.eurovisionimports.com/stockimage2roll.gif); }
  27. </style>
  28. <div class="rollover" > <a href="http://www.eurovisionimports.com/item2.html"></a> </div>
  29.  
  30. </style>
Jul 3 '12 #1
2 2118
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code.

There is no element that uses b as a tag.
Jul 3 '12 #2
ariful alam
185 100+
Ok, you have some problem in your code.

You used, .rollover a in your style tag. that means <a></a> tag in tag that class name is rollover. so, as your two div's class is rollover and both has <a></a> tag the first style setting is applied in both case.

you can add id attribute in both <a></a> tag like a1, a2. and in style tag use .rollover #a1, .rollover #a1:hover, .rollover #a2, .rollover #a2:hover respectively for every block. the solution is showed below:

Expand|Select|Wrap|Line Numbers
  1. <style type="text/css" >
  2. .rollover #a1 {
  3.     display : block;
  4.     width : 800px;
  5.     height : 124px;
  6.     background-image:url(http://www.eurovisionimports.com/stockimage1.jpg);
  7. }
  8.  
  9. .rollover #a1:hover {
  10.     display : block;
  11.     width : 800px;
  12.     height : 429.86px;
  13.     background-image:url(http://www.eurovisionimports.com/harleyfatrollover.gif);
  14. }
  15.  
  16. .rollover #a2 {
  17.     display : block;
  18.     width : 800px;
  19.     height : 124px;
  20.     background-image:url(http://www.eurovisionimports.com/stockimage2.jpg);
  21. }
  22.  
  23. .rollover #a2:hover {
  24.     display : block;
  25.     width : 800px;
  26.     height : 429.86px;
  27.     background-image:url(http://www.eurovisionimports.com/stockimage2roll.gif);
  28. }
  29. </style>
  30.  
  31.  
  32. <div class="rollover" > 
  33. <a id='a1' href="http://www.eurovisionimports.com/item1.html"></a
  34. <br />
  35. <a id='a2' href="http://www.eurovisionimports.com/item2.html"></a> 
  36. </div>
  37.  
Jul 9 '12 #3

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

Similar topics

2
by: TheKeith | last post by:
I'm having a bit of trouble with this script. I'm wondering if someone might help me. What I'm trying to do is to have a multiple image rollover whereby onmouseover, the image's source will cycle...
1
by: nick | last post by:
I have the following code: <style> #item1 { DISPLAY: block; BACKGROUND: url(ProjMenuImgs/ProjBtn.gif) no-repeat 0px 0px; WIDTH: 87px; HEIGHT: 94px; } #item1:hover { background-position: 0...
2
by: Cynthia | last post by:
I'm looking for javascript code that when I mouse over a menu item will display a picture elsewhere on the page. I know it exists, but the ones I've found so far just swap out the menu item in...
2
by: the other john | last post by:
I am looking for ideas on how to create a rollover that triggers an image rotation in another location. I know how to create a function for basic rollovers, image swapping sort of thing, but I...
3
by: Rob R. Ainscough | last post by:
Just curious why a VERY commonly used affect of rollover was NOT implemented in .NET 2.0 for web controls? Does anyone have a link to VB code that will show me how to build my own UserControl...
2
by: sachaburnett | last post by:
Hi everyone! I'm new to Javascript and am finding so much useful information on this group, so thanks to you all! I have a question about preloading images for onmouseover/out effects and...
1
by: KoRnDragon | last post by:
I need a Javascript function that will display X random images on a page that also doesn't display the same image twice. Bonus points if it grabs the max array from the folder and sets it. Even...
1
by: fredo | last post by:
Hi folks -- problem demo: http://www.simple-nude.com/main-2-demo.html In IE5.x and IE6, I want to display an image when the user rolls over a text link. The image does indeed display, but...
5
mariko
by: mariko | last post by:
I have some pictures on a web page and I want them to "get bigger" when the mouse hovers over them. With the little research I've done, it seems like it would be a rollover effect and something I can...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.