Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Jquery overlay works only once

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #28176
    kristjan07
    Member

    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)
  • The forum ‘JavaScript’ is closed to new topics and replies.