Skip to content

Instantly share code, notes, and snippets.

@dajve
Created April 9, 2018 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dajve/aab96fd02782a92d11b636ad5e96a34c to your computer and use it in GitHub Desktop.
Save dajve/aab96fd02782a92d11b636ad5e96a34c to your computer and use it in GitHub Desktop.
<?php $popupIncrement = 1; ?>
<?php while ($objectResult) : ?>
<tr>
<td>
<div class="popup" onclick="myFunction(<?php echo $popupIncrement; ?>); return false;">
<img src="" />
</div>
<span class="popuptext" id="myPopup<?php echo $popupIncrement; ?>">Trigger<span>
</td>
</tr>
<?php $popupIncrement++; ?>
<?php endwhile; ?>
<script>
var myFunction = function(i) {
var popup = document.getElementById("myPopup"+i);
popup.classList.toggle("show)";
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment