doujiaoben28596 2018-09-11 05:10
浏览 108

如何使用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.

  • 写回答

1条回答 默认 最新

  • dsepcxw181184853 2018-09-11 05:18
    关注

    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');
      })
    });
    
    评论

报告相同问题?

悬赏问题

  • ¥20 易康econgnition精度验证
  • ¥15 线程问题判断多次进入
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致