Get multiple datetimes using JQuery datetimepicker

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 -->

Answers 1

  • 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">');

Related Articles