[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

how to set a mouseover effect using jQuery?

Asked by lkrubner in Jquery, JavaScript

Tags: javascript, onmouseover, mouseover, jquery

I'd like to do a simple toggle for mouseovers. I've 4 thumbnail images, wrapped inside of links, and then one big DIV where a larger image can appear. The large image should depend on the last thumbnail that is mousedover. Of the 4 links, each is to have a border, when it has been chosen (that is mousedover). We are using text-decoration for the border. I'm trying this code:

jQuery(document).ready(function() {
  $(".view-thumb img").mouseover(function() {
   // get rid of the text decoration on all 4 thumbnails
   $(".view-thumb").css("text-decoration", "none");
   
   // now reapply the text-decoration to this particular link
    this.parentNode.style.textDecoration = "underline";
alert(this.parentNode.id);
  });
});

The alert() gets the id of the link, and when I look at in the browser, I can see that the code is correctly finding the link. Therefore, it seems to be I should be able to set its text decoration. I know I've got the right node because I've seen the id in that alert().



This doesn't seem to work at all. This seems to have no effect on the textdecoration of the element. The CSS style sheet is causing the link to have text-decoration on hover, but we want more than hover - if you mouseout of one thumbnail, but you don't mouse over another thumbnail, you'r last thumbnail should contiue to have text decoration.

What am I doing wrong?


These are some additional notes:


// this bit of CSS:
//
//          a:hover{
//                  text-decoration:underline;
//          }
//
// which is on line 16 of styles.css, causes a border to
// appear around the 4 small thumbnails that are underneath
// the main product image on the page. We need to make this
// border permanent, rather than merely onhover.
//

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
The HTML of the 4 thumbnails: 
 
<div id="prod-views">
       	<a id="view-1" class="view-thumb" href=""><img src="products-2_files/example-prod-view.gif" alt=""></a>
    <a id="view-2" class="view-thumb" href=""><img src="products-2_files/example-prod-view.gif" alt=""></a>
   <a id="view-3" class="view-thumb" href=""><img src="products-2_files/example-prod-view.gif" alt=""></a>
    <a id="view-4" class="view-thumb" href=""><img src="products-2_files/example-prod-view.gif" alt=""></a>
</div>
 
 
My jQuery code:
 
 
 
 
jQuery(document).ready(function() {
  $(".view-thumb img").mouseover(function() {
   // get rid of the text decoration on all 4 thumbnails
   $(".view-thumb").css("text-decoration", "none");
   
   // now reapply the text-decoration to this particular link
    this.parentNode.style.textDecoration = "underline";
alert(this.parentNode.id);
  });
});
[+][-]04/23/09 11:22 AM, ID: 24218175Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Jquery, JavaScript
Tags: javascript, onmouseover, mouseover, jquery
Sign Up Now!
Solution Provided By: hb69
Participating Experts: 2
Solution Grade: A
 
[+][-]04/23/09 11:15 AM, ID: 24218089Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/23/09 11:37 AM, ID: 24218332Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/23/09 11:46 AM, ID: 24218443Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625