Grow your CSS skills. Land your dream job.

Jquery overlay works only once

  • # February 26, 2010 at 5:04 pm

    I have a code

    Code:
    $(document).ready(function() {
    $(‘#tellimine’).hide();
    $(‘a#liitu’).click(function() {
    $(‘#tellimine’).show();
    var docHeight = $(document).height();
    $(“body”).append(“

    “);
    $(“#overlay”)
    .height(docHeight)
    .css({
    ‘opacity’ : 0.6,
    ‘position': ‘absolute’,
    ‘top': 0,
    ‘left': 0,
    ‘background-color': ‘black’,
    ‘width': ‘100%’,
    ‘z-index': 1
    });
    });
    $(‘a#sulge’).click(function() {
    $(‘#tellimine’).hide();
    $(‘#overlay’).hide();
    });
    return false;
    });

    Problem is that the overlay is applied only once when i click to #liitu. I have to refresh the page to make it work again. :?
    Not really a JS expert.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".