0

HTML Structure:

<a class="fadeThis"  id="paperoff" href="#"><span id="paperon" class="hover">News</span></a>

JAVASCRIPT:

$('.fadeThis > .hover').empty();    

$('.fadeThis').each(function () {
    var text = $(this).text();
    $(this).append(''+text+'');

    var $span = $('> span.hover', this).css('opacity', 0);  
    $(this).hover(function () {
        $span.stop().fadeTo(500, 1);
    }, function () {    
        $span.stop().fadeTo(500, 0);
    }).click (function () {
        // HERE SOMETHING THAT TELLS TO NOT FADE BACK THE SPAN (ONLY FOR THE CLICKED DIV).
});

});
1
  • K sorry! The link is here: Laye.rs , when you click the upload button in the menu, I want that it keeps fade in and doesn't fade out! Because the upload is active! Commented Jun 6, 2011 at 13:40

1 Answer 1

1

Your question is not very clear, but do you want someting like this?

var fadeBlock = false;
$(this).hover(function () {
$span.stop().fadeTo(500, 1);
}, function () {
    if (!fadeBlock) {
      $span.stop().fadeTo(500, 0);
} else { fadeBlock = false;}
}).click (function () {
   fadeBlock = true;
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.