1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Show a modal windows meanwhile load page

Discussion in 'jQuery' started by piropeator, Jun 23, 2016.

  1. #1
    I have using bootstrap, and I want to show a modal window automatically, without clicking any button. How do I do that?

        <div class="container">
            <a href="#windows1" class="btn btn-primary btn-lg" data-toggle="modal">Botón 1</a>
    
            <div class="modal fade" id="windows1">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <h4 class="modal-title">Header Windows</h4>
                        </div>
    
                        <div class="modal-body">
                            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque doloremque, ratione impedit velit doloribus commodi illo vitae nesciunt quod quis, accusamus sed itaque officiis aut ullam facilis aperiam possimus ea.
                            </p>
                        </div>
    
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                            <button type="button" class="btn btn-primary">Save Changes</button>                       
                        </div>
                    </div>
                </div>   
            </div>
        </div>
    HTML:
     
    Solved! View solution.
    piropeator, Jun 23, 2016 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Dunno how bootstrap does models, but if that modal is hidden using hide(), just do
    $('#windows1').show();
     
    PoPSiCLe, Jun 23, 2016 IP
  3. piropeator

    piropeator Well-Known Member

    Messages:
    194
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    121
    #3
    Sorry I dont understand exactly. My modal is not hidden, window modal to show when I click in a button.
    That code is in script?
     
    piropeator, Jun 23, 2016 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    Yes... *shakes head in disbelief*

    You want to show a modal when the page opens. Then hide the modal EITHER with a class, then swap that class out, or hide it with javascript / jQuery (.hide()) and show() it on page load.

    This is VERY basic, and if you don't know this, you should perhaps not be making websites. Harsh, but true.

    Also, you've just shown the code for the modal, nothing else. Since you haven't showed what is in the script, how am I to know what code you already have.
     
    PoPSiCLe, Jun 23, 2016 IP
  5. #5
    qwikad.com, Jun 24, 2016 IP