邪性 пре 3 година
родитељ
комит
7d749c94da
4 измењених фајлова са 85 додато и 22 уклоњено
  1. 42 12
      .idea/workspace.xml
  2. 5 0
      css/exam_detail_img.css
  3. 3 0
      css/exam_detail_img.less
  4. 35 10
      js/exam_detail_img.js

+ 42 - 12
.idea/workspace.xml

@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ChangeListManager">
-    <list default="true" id="82570a17-8430-4238-ae79-81bbbd2de81f" name="Default Changelist" comment="index 轮播" />
+    <list default="true" id="82570a17-8430-4238-ae79-81bbbd2de81f" name="Default Changelist" comment="">
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+    </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -80,6 +82,18 @@
         </counts>
       </usages-collector>
     </session>
+    <session id="-1918643531">
+      <usages-collector id="statistics.file.extensions.open">
+        <counts>
+          <entry key="ico" value="1" />
+        </counts>
+      </usages-collector>
+      <usages-collector id="statistics.file.types.open">
+        <counts>
+          <entry key="Image" value="1" />
+        </counts>
+      </usages-collector>
+    </session>
   </component>
   <component name="FileEditorManager">
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
@@ -92,7 +106,7 @@
           </provider>
         </entry>
       </file>
-      <file pinned="false" current-in-tab="true">
+      <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/index.html">
           <provider selected="true" editor-type-id="text-editor">
             <state relative-caret-position="330">
@@ -107,6 +121,11 @@
           </provider>
         </entry>
       </file>
+      <file pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/imgs/favicon.ico">
+          <provider selected="true" editor-type-id="images" />
+        </entry>
+      </file>
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/h_news/news_list.html">
           <provider selected="true" editor-type-id="text-editor">
@@ -186,9 +205,9 @@
     <detection-done>true</detection-done>
     <sorting>DEFINITION_ORDER</sorting>
   </component>
-  <component name="ProjectFrameBounds">
-    <option name="x" value="-45" />
-    <option name="y" value="49" />
+  <component name="ProjectFrameBounds" extendedState="1">
+    <option name="x" value="28" />
+    <option name="y" value="65" />
     <option name="width" value="1933" />
     <option name="height" value="1046" />
   </component>
@@ -215,6 +234,11 @@
               <item name="gs_try" type="462c0819:PsiDirectoryNode" />
               <item name="h_news" type="462c0819:PsiDirectoryNode" />
             </path>
+            <path>
+              <item name="gs_try" type="b2602c69:ProjectViewProjectNode" />
+              <item name="gs_try" type="462c0819:PsiDirectoryNode" />
+              <item name="imgs" type="462c0819:PsiDirectoryNode" />
+            </path>
             <path>
               <item name="gs_try" type="b2602c69:ProjectViewProjectNode" />
               <item name="gs_try" type="462c0819:PsiDirectoryNode" />
@@ -312,14 +336,20 @@
       <option name="project" value="LOCAL" />
       <updated>1629101739388</updated>
     </task>
-    <option name="localTasksCounter" value="8" />
+    <task id="LOCAL-00008" summary="index 轮播">
+      <created>1629102754121</created>
+      <option name="number" value="00008" />
+      <option name="presentableId" value="LOCAL-00008" />
+      <option name="project" value="LOCAL" />
+      <updated>1629102754121</updated>
+    </task>
+    <option name="localTasksCounter" value="9" />
     <servers />
   </component>
   <component name="ToolWindowManager">
-    <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
-    <editor active="true" />
+    <frame x="-45" y="49" width="1933" height="1046" extended-state="1" />
     <layout>
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.15724947" />
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.15750134" />
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
       <window_info id="Favorites" order="2" side_tool="true" />
       <window_info anchor="bottom" id="Message" order="0" />
@@ -456,9 +486,6 @@
     <entry file="file://$PROJECT_DIR$/imgs/app_dowload.png">
       <provider selected="true" editor-type-id="images" />
     </entry>
-    <entry file="file://$PROJECT_DIR$/imgs/favicon.ico">
-      <provider selected="true" editor-type-id="images" />
-    </entry>
     <entry file="file://$PROJECT_DIR$/33" />
     <entry file="file://$PROJECT_DIR$/index.html">
       <provider selected="true" editor-type-id="text-editor">
@@ -473,5 +500,8 @@
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/imgs/favicon.ico">
+      <provider selected="true" editor-type-id="images" />
+    </entry>
   </component>
 </project>

+ 5 - 0
css/exam_detail_img.css

@@ -203,6 +203,11 @@
   padding: 20px;
   position: relative;
 }
+@media screen and (max-width: 768px) {
+  .body .prog {
+    padding: 20px 5px;
+  }
+}
 .body .prog .title {
   color: #2382ff;
   position: absolute;

+ 3 - 0
css/exam_detail_img.less

@@ -237,6 +237,9 @@
     background-color: #eef5ff;
     border-radius: 5px;
     padding: 20px;
+    @media screen and (max-width:768px) {
+      padding: 20px 5px;
+    }
     position: relative;
     .title{
       color: @body-bg;

+ 35 - 10
js/exam_detail_img.js

@@ -2,15 +2,6 @@ $(function () {
   const globaldata = {
     active: null,
     maxlength: null,
-    addHandler: function (element, type, handler) {
-      if (element.addEventListener) {
-        element.addEventListener(type, handler, false);
-      } else if (element.attachEvent) {
-        element.attachEvent("on" + type, handler);
-      } else {
-        element["on" + type] = handler;
-      }
-    }
   };
   // 实现跳转
   $(".my-nav").click(function (e) {
@@ -54,6 +45,7 @@ $(function () {
   let showdom = $(".pro>.pro-content");
   // 显示数值
   let pro_show = $(".pro>.pro-show");
+
   movedom.mousedown(function (e) {
     e.preventDefault();
     $(".prog>.title").hide();
@@ -62,7 +54,6 @@ $(function () {
     $(this).css('left') ? $(this).css('left') : $(this).css('left', '0px');
     let startLeft = parseInt($(this).css('left'));
     let $that = $(this);
-    var move = 'ontouchstart' in document ? 'touchstart' : 'mousemove';
     document.onmousemove = function (e) {
       e.preventDefault();
       let moveX = (e.pageX - startX) > 0 ? true : false;
@@ -80,6 +71,40 @@ $(function () {
   })
   movedom.mouseup(function () { document.onmousemove = null })
   movedom.mouseleave(function () { document.onmousemove = null })
+  // 手机端更改
+  let x1, y1, oldTime, newTime, olfLeft, newLeft;
+  movedom[0].addEventListener("touchstart", function (e) {
+    e.preventDefault();
+    $(".prog>.title").hide();
+    $(".pro>.pro-title").hide();
+    var touches = e.changedTouches;
+    x1 = touches[0].pageX;
+    olfLeft = this.offsetLeft;
+  }, false)
+
+  movedom[0].addEventListener("touchmove", function (e) {
+    e.preventDefault();
+    var x2 = e.changedTouches[0].pageX;
+    newLeft = x2 - x1;
+    nowLeft = olfLeft + newLeft;
+    if (nowLeft < 0) {
+      nowLeft = 0;
+    }
+    if (nowLeft > maxlength) {
+      nowLeft = maxlength;
+    }
+    showdom.css("width", nowLeft + "px");
+    $(this).css("left", nowLeft + "px");
+    let percent = nowLeft / maxlength * gross;
+    percent = Math.round(percent);
+    pro_show.css("left", nowLeft).text(percent);
+  }, false)
+  function handleEnd (e) {
+    this.removeEventListener("touchmove", handleEnd, false);
+  }
+  movedom[0].addEventListener("touchend", function () {
+    this.removeEventListener("touchmove", handleEnd, false);
+  }, false)
 
   // 不能实现的事件
   function warm () {