ソースを参照

新增图片点击查看功能

UnknownO 3 年 前
コミット
d4fea3cead
2 ファイル変更2 行追加2 行削除
  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 {