Ok, First, as I pointed out in comments, you're Array is not being filled, thus your if statements are misfiring. That aside, while the class naming system is not so bad (though I think dashes are more standard with class names than lower camel casing), There is some serious conflict in your jQuery.
Your CSS is fine as is and the HTML structure is not horrid. I could change either, but I would start with the Javascript, as I imagine, you've probably already put a lot of HTML, and possibly CSS down. The js is a simple and easy change. The following is how "I" might rewrite it if it was handed to me. I believe it's achieving the effect you desire, without a long drawn if statement. I also keep record of "original text" using jQuery's .data() method, though I see no use for it at the moment.
$(function() {
// saves "original text" to LI element's data
$('.skillsDouble li').each(function(i) { $(this).data("oText", $.trim($(this).text())); });
// begins "delegating" events to selected elements, in this case, 'mouseenter' to all LI's of .skillsDouble
$(document).on("mouseenter", '.skillsDouble li', function(e) {
// just to make things easy, I grab the stuff we want to work with and make it local variables
var txt = $(this).find('.text'), // our text element
rate = $(this).find('[class*=Star]'), // our ratings element based on any inner element having a class name "containing the phrase 'Star'"
oText = $(this).data("oText"); // our original text, if you still want it for something else
txt.stop().hide(); // hide the text
rate.stop().animate({ // show the stars
left: 400,
opacity: "show"
});
})
.on("mouseleave", '.skillsDouble li', function(e) { // now delegate mouseleave
// same localvariables
var txt = $(this).find('.text'), rate = $(this).find('[class*=Star]'), oText = $(this).data("oText");
rate.stop().hide(); // hide the stars
txt.stop().fadeIn(1000); // show the text
})
})
Alt Example
- Shows some alternate use of "fade" effects as well
originaltext[$(this).index('.skillsDouble li')]never finds anything becauseoriginaltextis never set, right?