0

I'm working on a site where a list of items are 100% opacity and once an item is hovered, all other items reduce to 30% opacity. I this working correctly using the code below. Now what I need is for the item that is clicked on to remain at 100% opacity and removing the fade from the other items. Can anyone help? Thanks

$(function() {
$("#input_1_8>li").hover( 
function() {}, 
function() {     
$('#input_1_8>li').fadeTo(0.1, 1.0); 
});

$("#input_1_8>li").hoverIntent(
function(){
$(this).attr('class', 'current'); // Add class .current
$(this).siblings().fadeTo(0.1, 0.3); // Fade other items to 30%
$(this).fadeTo(0.1, 1.0); // Fade current to 100%
}, 
function(){            
$(this).removeClass("current"); // Remove class .current
$(this).fadeTo(0.1, 1.0); // This should set the other's opacity back to 100% on mouseout   
}
); 
$("#input_1_8>li").on('click', function(){
$("#input_1_8>li").unbind("mouseenter").
               unbind("mouseleave");
});


});

1 Answers1

0

Try :

$("#sites>li").on('click', function(){
    $("#sites>li").unbind("mouseenter").
                   unbind("mouseleave");
});
AlienWebguy
  • 76,997
  • 17
  • 122
  • 145
  • Not sure if I put this in the right spot. It is resetting all list items to 100% opacity when clicked. – Keith Higginbotham Jan 24 '13 at 17:26
  • Isn't that what you wanted? "the item that is clicked on to remain at 100% opacity and removing the fade from the other items" – AlienWebguy Jan 24 '13 at 17:29
  • No, I'm sorry I didn't word that right. I want the item to remain 100% and the other items to remain faded to 30%. So the hover will not effect them anymore. – Keith Higginbotham Jan 24 '13 at 17:31
  • I edited my question to match how I have the code currently. Still not working, but possibly because I don't have it right. – Keith Higginbotham Jan 24 '13 at 17:47
  • I'm sorry, it's working almost right. The only thing else I would like it to do is not have a hover effect once a list item is clicked. So that the clicked item doesn't fade when the other items are hovered. Thanks for your help. – Keith Higginbotham Jan 24 '13 at 17:50