Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

onmouseover of one element affecting css hover of others

Posted on 2003-11-10
11
Medium Priority
?
732 Views
Last Modified: 2008-02-26
Hi this is a simple question I just do not know the JS syntax.  I want a mouseover image to activate a mouseover on another element.

As an example visit http://www.greenteadesign.com/test.html

Now look at the mouseover on the thumbnail in the left panel.  It currently borders the thumb in green as well as showing a transparent gif on the main image (right panel).

What I want to do is have the mouseover on the transparent gif (right panel), border the corresponding thumbnail (left panel)

Here is the JS for the thumbnails:

<script language="JavaScript1.2">
/*
Highlight Image Script II-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/
     
function borderit(which,color){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
which.style.borderColor=color
}
}
</script>

And here is the code on the thumb referencing the JS for the thumbnail:

<a href="stereostep.html" class="small" onMouseOut="toggle('item1')" onmouseover="toggle('item1')"><img src="images/steptansu/stereostep-2tone-thumb.jpg" width=65 height=55 alt="" border=0 class="borderimage" onMouseover="borderit(this,'#647F5B')" onMouseout="borderit(this,'white')"><br></a>

Finally here is the code for one of the transparent gifs:

<div id="Stepper" style="position:absolute; width:165px; height:167px; z-index:9; left: 524px; top: 296px" onMouseOver="toggle('item1')" onMouseOut="toggle('item1')"><a href="#"><img src="spacer.gif" width="165" height="167" border="0"></a></div>

Thanks in advance,
Hayden
0
Comment
Question by:Quarfelburg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
11 Comments
 
LVL 16

Expert Comment

by:jaysolomon
ID: 9717200
Not a problem, we still need to get your positioning correct first
0
 
LVL 25

Expert Comment

by:devic
ID: 9717580
0
 

Author Comment

by:Quarfelburg
ID: 9717641
Thanks Devic, it's sweet and simple!  Ok now what if I want to change a css hover?

For example http://www.greenteadesign.com/test2.html

The green border with the text in it saying stereo step I want to be hovered as well when you mouseover the transparenet gif.

The css for that is:

A.roomsthumbs {
display: block;
width: 65px;
height: 38px;
text-align: center;
text-decoration: none;
font-family: Verdana;
font-size: 9px;
color: #647F5B;
border: solid 1px #647F5B;
padding-top: 6px;
}
            
A.roomsthumbs:hover {
color: #ffffff;
border: solid 1px #647F5B;
background-color: #647F5B;
text-decoration: none;
}


0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 25

Accepted Solution

by:
devic earned 2000 total points
ID: 9717821
0
 

Author Comment

by:Quarfelburg
ID: 9717914
It works like a charm, though admittedly I don't understand the code =)

By the way Devic, and useful books/tuts out there that could help me understand this?

Cheers,
Hayden
0
 
LVL 25

Expert Comment

by:devic
ID: 9717941
Hayden, look here:

http://www.dannyg.com/pubs/index.html

to have a book is good, to read the book is nice ;)
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 9717989
danny g has some good books. I have the Javascript Bible he wrote.

Here is a link to Javascript Unleashed by Sams publishing. You can down load samples that is in the book online.
http://www.samspublishing.com/isapi/product_id~{8A8A55EB-4C2C-4E37-8980-9598AD4BF855}/selectDescTypeId~{5F7BB313-BBC4-4A9E-A577-562A760FE491}/st~{D981C3BE-ED1F-42B5-AA2E-3DEC1D1A93A7}/session_id~{3CD04DE3-0648-4631-8F82-2CE3FDD5FEDA}//catalog/product.asp


Here is the zip file of them
http://www.samspublishing.com/isapi/product_id~{8A8A55EB-4C2C-4E37-8980-9598AD4BF855}/selectDescTypeId~{5F7BB313-BBC4-4A9E-A577-562A760FE491}/st~{D981C3BE-ED1F-42B5-AA2E-3DEC1D1A93A7}/session_id~{3CD04DE3-0648-4631-8F82-2CE3FDD5FEDA}//content/images/0672324318/downloads/code.zip
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 9717998
copy paste the whole thing in the address bar
0
 

Author Comment

by:Quarfelburg
ID: 9718071
Devic in the test you showed me there is an underline for the text within the green boxes.  This is because a:hover is no longer overrided.  How do I get rid of the underline without changing a:hover?
0
 

Author Comment

by:Quarfelburg
ID: 9718078
I just put another a:hover on the actual page instead of the stylesheet.  Works fine.  If theres a better way let me know.

Cheers.
0
 
LVL 25

Expert Comment

by:devic
ID: 9718166
0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question