Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Popup Selector Not Pickup ID

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #192914
    wolfgang1983
    Participant

    I am trying to make a all in one script, but I can not seem to make the pop up selector work with the add image function on the img tag id="example' + image_row + '"

    How would it be possible to get the pop up selector so can pic up id="example' + image_row + '"


    var image_row = ; function addImage() { html = '<tr id="image-row' + image_row + '">'; html += '<td>'; html += ''; html += '</td>'; html += '<td>'; html += ''; html += '</td>'; html += '<td>'; html += '<img src="" class="img-thumbnail" id="example' + image_row + '" style="width: 100px; height:100px; cursor: pointer;">'; html += '</td>'; html += '</tr>'; $('#images tbody').append(html); image_row++; } $(document).ready(function() { $('body').popover({ selector: '#example + image_row + ', placement: 'right', html: 'true', content : '<span class="btn btn-primary btn-file"><i class="fa fa-pencil"></i> <input onchange="readURL(this)" id="file-input" type="file" name="userfile[]"/></span>' }); });
    #192961
    Shikkediel
    Participant

    Not exactly sure what the plan is here but it starts with incorrect code :

    var image_row = ;
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.