2017-02-22 06:47
浏览 35


How to show image in modal (#photoss), using jquery which id is called from :

 <div class=" top-deal">   
     <a data-toggle="modal" href="#" data-target="#tallModal" class="mask tt" ... photoss="<?php echo $rec->ss;?>" > 

This my script :

    <script type="text/javascript">



                 $('#photoss').html('<img src="'+base_url+'upload/screenshoot/'+ss+'" class="img-responsive">'); // show photo

This my modal

    <div id="tallModal" class="modal modal-wide fade">
    <div class="modal-dialog">
         <h4 id='namaaplikasi'> Nama Aplikasi</h4> </br>
             <div id="photoss">

  </div><!-- /.modal -->

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

  • dongzheng4556 2017-02-22 07:00

    You can show image in modal like this.

    Use anchor as:

    Remove data target attribute and use it as normal anchor as.

     <a href="javascript:;"  class="mask tt"  photoss="<?php echo $rec->ss;?>" > 

    Make the script like below:

     <script type="text/javascript">
                    var ss  =    $(this).attr("photoss");
                    var base_url = "your base url";
                     $('#photoss').html('<img src="'+base_url+'upload/screenshoot/'+ss+'" class="img-responsive">');
    解决 无用
    打赏 举报

相关推荐 更多相似问题