Witam, pytanie trywialne , ale sam już nie wiem gdzie robię błąd
mam modala
<!-- The Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<!-- Modal content -->
<div class="modal-content"> <div class="modal-header"> <p>Some text in the Modal Body
</p> <p>Some other text...
</p> <div class="modal-footer">
później scripty
<script type="text/javascript"> // Get the modal
var modal = document.getElementById('myModal');
// Get the button that opens the modal
var btn = document.getElementById("myBtn");
// Get the
<span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks the button, open the modal
btn.onclick = function() {
modal.style.display = "block";
}
// When the user clicks on
<span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
//window.onclick = function(event) {
// if (event.target == modal) {
// modal.style.display = "none";
// }
// }
uruchamia się po wciśnięciu przycisku, ale jak zrobić aby uruchamia się po załadowaniu strony
zamiast powyższego dawałem:
<script type="text/javascript"> $(document).ready( function(){
$('#myBtn').modal('show');
});
ale bez efektu..