浏览代码

新增图片点击查看功能

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 {