1

Im trying to load a modal after a 3 second page load delay The code below opens the modal however i cannot close it and the grey overlay is on top of the content etc

Code below

<script type="text/javascript">
$(document).ready(function(){
setTimeout(function() {
$('#myModal').modal();
}, 3000);
});
</script>
            <!-- Modal HTML -->
        <div id="myModal" class="modal fade">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                        <h4 class="modal-title">Join IQ Option Today</h4>
                    </div>
                    <div class="modal-body text-center">
                        <a target="_blank" href="mylink"><img src="myimage.jpg" width="300" height="600" /></a>
                    </div>
                    <div class="modal-footer">

                    </div>
                </div>
            </div>
        </div>
Chris Yates
  • 65
  • 10
  • See that your modal is not nested under any other elements... If it is, try to put it just before the body closing tag – Jaqen H'ghar May 01 '17 at 17:17
  • makes no difference at all still faded background overlaying entire image & screen & still unable to close – Chris Yates May 01 '17 at 17:28
  • I have also tried the solution involving removing the position: style as well as outlined here http://stackoverflow.com/questions/10636667/bootstrap-modal-appearing-under-background?rq=1 but still no difference – Chris Yates May 01 '17 at 17:42

1 Answers1

1

Fixed!

My css contained z-index:1

I've commented that out and it now works perfectly!

AP.
  • 8,082
  • 2
  • 24
  • 33
Chris Yates
  • 65
  • 10