Browse Source

修改新闻的上一篇和下一篇的按钮

littlegreen 6 months ago
parent
commit
fc0ee0fc77
1 changed files with 31 additions and 20 deletions
  1. 31 20
      cms-editor/templates/default_v5/news_content.html

+ 31 - 20
cms-editor/templates/default_v5/news_content.html

@@ -23,15 +23,25 @@
                 margin: 0 auto;
                 display: block;
             }
-            .new-content-body span{
+
+            .new-content-body span {
                 text-wrap: wrap;
             }
         }
-        #content{
-            width:90%;
-            height:100%;
-            padding:0;
-            margin:10px auto;
+
+        #content {
+            width: 90%;
+            height: 100%;
+            padding: 0;
+            margin: 10px auto;
+        }
+        .dreamer-prevnext li {
+            list-style: none;
+        }
+
+        .dreamer-prevnext a {
+            text-decoration: none;
+            color: inherit;
         }
     </style>
 </head>
@@ -120,21 +130,20 @@
                     </div>
                 </div>
                 <div class="row mt-lg-5 mt-2">
-                    <div class="col text-start">
+                    {dreamer-cms:prevnext layout="prev,next" /}
+                    <!-- <div class="col text-start">
                         <a class="link-default" href="#">
                             <span style="color: rgb(33, 37, 41);">
                                 &lt; 上一篇
                             </span>
-                            <br><br>
                         </a>
                     </div>
                     <div class="col text-end">
                         <a class="link-default" href="#"><span style="color: rgb(33, 37, 41);">
                                 下一篇
                                 &gt;</span>
-                            <br><br>
                         </a>
-                    </div>
+                    </div> -->
                 </div>
             </div>
         </section>
@@ -143,17 +152,19 @@
     <script src="{dreamer-cms:template /}assets/js/jquery.min.js"></script>
     <script src="{dreamer-cms:template /}assets/bootstrap/js/bootstrap.min.js"></script>
     <script src="{dreamer-cms:template /}assets/js/bs-init.js"></script>
-    <script>    
+    <script>
         // var a = $("#conetent > p")
-        var pArr = document.querySelectorAll("#content p")
-        pArr.forEach(element => {
-            element.style.width = "100%"
-        });
-        var imgArr = document.querySelectorAll("#content img")
-        imgArr.forEach(i => {
-            i.style.width = "100%"
-            i.style.height = "auto"
-        });
+        $(function () {
+            var pArr = document.querySelectorAll("#content p")
+            pArr.forEach(element => {
+                element.style.width = "100%"
+            });
+            var imgArr = document.querySelectorAll("#content img")
+            imgArr.forEach(i => {
+                i.style.width = "100%"
+                i.style.height = "auto"
+            });
+        })
     </script>
 </body>