Explorar o código

新增图片点击查看功能

UnknownO %!s(int64=3) %!d(string=hai) anos
pai
achega
d4fea3cead
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      pages/card.php
  2. 1 1
      pages/homepage.php

+ 1 - 1
pages/card.php

@@ -32,7 +32,7 @@ try {
                 <?php
                 if (!empty($row['image'])) {
                 ?>
-                    <img style="max-height: 1000px" onerror="randomImage()" src="<?php echo $row['image']; ?>" />
+                    <img style="max-height: 1000px" onclick="if($(this).attr('origin-src') == undefined) { window.open($(this).attr('src')) } else { window.open($(this).attr('origin-src')) }" onerror="randomImage()" src="<?php echo $row['image']; ?>" />
                 <?php
                 } else {
                 ?>

+ 1 - 1
pages/homepage.php

@@ -66,7 +66,7 @@ try {
                     if (!empty($row['image'])) {
                     ?>
                         <div v-if="data.image != ''">
-                            <img style="max-height: 2000px" onerror="randomImage()" src="<?php echo $row['image']; ?>" />
+                            <img style="max-height: 2000px" onclick="if($(this).attr('origin-src') == undefined) { window.open($(this).attr('src')) } else { window.open($(this).attr('origin-src')) }" onerror="randomImage()" src="<?php echo $row['image']; ?>" />
                         </div>
                     <?php
                     } else {