1

I have a plugin that I've downloaded that dynamically adds an element to the page upon clicking an image. I'm trying to add some JavaScript (slideUp()) to one of the newly added elements, but it's not working:

<script type="text/javascript">
    $('.image').imageClick({ 'fadeSpeed': 1000, 'targetHeight': 210 });
    $(".container").mouseover(function() {
        $(".overlay").hide().slideUp();
    });
</script>

How can I make this work?

Hiral
  • 14,954
  • 11
  • 36
  • 57
Bagwell
  • 1,568
  • 3
  • 16
  • 24

1 Answers1

1

Using on will solve this for you:

$(document).on('mouseover', '.container', function() {
    $(".overlay").hide().slideUp();
});
Enijar
  • 5,585
  • 8
  • 37
  • 60