Pardeep
Pardeep

Reputation: 2283

How do I open next modal with data-url?

This is my First modal it have data URL and working well.

            <div class="panel panel-primary panelgames" data-url="<php echo site_url(); ?>/games/play/memorymatch">
            <div class="panel-heading">
            <h3 class="panel-title">Memory Match</h3>
            </div>
            <div class="panel-body">
                <img src="<?php echo site_url(); ?>/images/games/3.png" />
            </div>
        </div>

This is my second modal which I want to open after click on "click to begin next Game" here is the image I want to open this modal

         <div class="panel panel-primary <?php   if(!$this->session->userdata('user_id') || $this->session->userdata()['is_paid'] != 1){  echo "panelgames-notActive";} else{ echo "panelgames"; } ?>" data-url="<?php echo site_url(); ?>/games/play/planes">
            <div class="panel-heading" <?php   if(!$this->session->userdata('user_id') || $this->session->userdata()['is_paid'] != 1){ ?> style="background: #b3b3b3;!important" <?php } ?>>
            <h3 class="panel-title" style="color: #FFFFFF; font-size: 16px">Planes</h3>
            </div>
            <div class="panel-body">
            <img class="img img-responsive" src="<?php  echo site_url(); ?>/images/games/2.png" />
            </div>
        </div>

here are all the models

I want to open one by one after one game is completed all have data-url attribute please check and tell me. Thanks in advance.

Upvotes: 2

Views: 339

Answers (1)

developer
developer

Reputation: 62

you can open the modal manually by using this

.

$(document).ready(function(){
  var show_btn=$('.show-modal');
  var show_btn=$('.show-modal');
  //$("#testmodal").modal('show');

    show_btn.click(function(){
      $(".panelgames").modal('show');
  })
});

Upvotes: 1

Related Questions