JeeGit 官方论坛

找回密码
立即注册
搜索
热搜: 活动 交友 discuz
发新帖

1

收听

0

听众

192

主题
发表于 2022-10-24 15:40:45 | 查看: 1007| 回复: 2
如何快速追增一个菜单


参考代码:



  1. INSERT INTO "sys_menu" ("menu_id", "menu_name", "parent_id", "order_num", "path", "component", "query_param", "is_frame", "is_cache", "menu_type", "visible", "status", "perms", "icon", "create_by", "create_time", "update_by", "update_time", "remark") VALUES (1582179865614339986, '旋转缩放等操作', 1581854180384014337, 260, '260', 'openlayer/260', '', '1', '0', 'C', '0', '0', NULL, 'star', 'admin', '2022-10-18 08:41:04', 'admin', '2022-10-18 11:31:52.846', '');




  2. INSERT INTO "sys_menu" ("menu_id", "menu_name", "parent_id", "order_num", "path", "component", "query_param", "is_frame", "is_cache", "menu_type", "visible", "status", "perms", "icon", "create_by", "create_time", "update_by", "update_time", "remark") VALUES (1582179865614339987, '间谍层Layer Spy', 1581854180384014337, 270, '270', 'openlayer/270', '', '1', '0', 'C', '0', '0', NULL, 'star', 'admin', '2022-10-18 08:41:04', 'admin', '2022-10-18 11:31:52.846', '');




  3. INSERT INTO "sys_menu" ("menu_id", "menu_name", "parent_id", "order_num", "path", "component", "query_param", "is_frame", "is_cache", "menu_type", "visible", "status", "perms", "icon", "create_by", "create_time", "update_by", "update_time", "remark") VALUES (1582179865614339988, '选择元素', 1581854180384014337, 280, '280', 'openlayer/280', '', '1', '0', 'C', '0', '0', NULL, 'star', 'admin', '2022-10-18 08:41:04', 'admin', '2022-10-18 11:31:52.846', '');



  4. INSERT INTO "sys_menu" ("menu_id", "menu_name", "parent_id", "order_num", "path", "component", "query_param", "is_frame", "is_cache", "menu_type", "visible", "status", "perms", "icon", "create_by", "create_time", "update_by", "update_time", "remark") VALUES (1582179865614339989, '地图加载事件', 1581854180384014337, 290, '290', 'openlayer/290', '', '1', '0', 'C', '0', '0', NULL, 'star', 'admin', '2022-10-18 08:41:04', 'admin', '2022-10-18 11:31:52.846', '');




  5. INSERT INTO "sys_menu" ("menu_id", "menu_name", "parent_id", "order_num", "path", "component", "query_param", "is_frame", "is_cache", "menu_type", "visible", "status", "perms", "icon", "create_by", "create_time", "update_by", "update_time", "remark") VALUES (1582179865614339990, '矢量被选中', 1581854180384014337, 300, '300', 'openlayer/300', '', '1', '0', 'C', '0', '0', NULL, 'star', 'admin', '2022-10-18 08:41:04', 'admin', '2022-10-18 11:31:52.846', '');




  6. INSERT INTO "sys_menu" ("menu_id", "menu_name", "parent_id", "order_num", "path", "component", "query_param", "is_frame", "is_cache", "menu_type", "visible", "status", "perms", "icon", "create_by", "create_time", "update_by", "update_time", "remark") VALUES (1582179865614339991, '动画显示', 1581854180384014337, 310, '310', 'openlayer/310', '', '1', '0', 'C', '0', '0', NULL, 'star', 'admin', '2022-10-18 08:41:04', 'admin', '2022-10-18 11:31:52.846', '');
复制代码


发表于 2022-11-16 12:37:45
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="utf-8" />
  5.     <title>Move mouse pointer</title>
  6.     <style>
  7.         * {
  8.             cursor: none;
  9.         }
  10.         .block{
  11.             display: flex;
  12.             justify-content: space-between;
  13.         }
  14.         img {
  15.             pointer-events: none;
  16.             position: absolute;
  17.         }
  18.     </style>
  19. </head>

  20. <body>
  21.     <img id="cursor" src="./mouse_cursor.png" width="16" height="22" />

  22.     <div class="block">
  23.         <button id="btn1">Button 1</button>
  24.         <button id="btn2">Button 2</button>
  25.     </div>

  26.        
  27.         <script>
  28. var x=20;
  29. var y=7;
  30. let cursor = document.getElementById("cursor");
  31. let btn1 = document.getElementById("btn1");
  32. let btn2 = document.getElementById("btn2");

  33. let rect = btn2.getBoundingClientRect();
  34. let finalPositionX = rect.left + rect.width/2;
  35. let finalPositionY = rect.top + rect.height/2;


  36. window.addEventListener("mousemove", (e) => {
  37. x = e.clientX;
  38. y = e.clientY;

  39. cursor.style.left = x + "px";
  40. cursor.style.top = y + "px";
  41. });

  42. btn1.addEventListener("mouseup", (e) => {

  43. console.log(cursor.style.left);
  44. console.log(cursor.style.top );
  45. console.log(finalPositionX);
  46. console.log(finalPositionY );
  47.                         setInterval(function () {
  48.                         x=x+1;
  49.                         y=y+1;
  50.                         cursor.style.left = x + "px";
  51.                         cursor.style.top = y + "px";
  52.             },10)


  53. })
  54.         </script>
  55. </body>
  56. </html>
复制代码

回复 显示全部楼层 道具 举报

发表于 2022-11-16 20:43:01
  1.   var ckname=('ck'+(currentIndex+1)+(that.questions[currentIndex].scoresAnswer));
  2.                                     



  3.   $.each(that.questions,function(index,value){
  4.                             setInterval(function () {
  5.                                      var ckname=('ck'+(index+1)+(value.id));
  6.                                      console.log($("input[name='"+ckname+"'").offset().left)
  7.                                       console.log($("input[name='"+ckname+"'").offset().top)
  8.                                  cursor.style.left = $("input[name='"+ckname+"'").offset().left+"px";
  9.                                          cursor.style.top =  $("input[name='"+ckname+"'").offset().top+"px";
  10.                              $("input[name='"+ckname+"'").eq(value.scoresAnswer).attr("checked",'true');
  11.                                  x=x+80;
  12.                                         y=y+20;
  13.                                         cursor.style.left = x + "px";
  14.                                         cursor.style.top = y + "px";
  15.                            
  16.                             },1000)
  17.                        
  18.                     });
  19.                                        
  20.                                        
  21.                                          $.each(that.questions,function(index,value){
  22.                             setInterval(function () {
  23.                                      var ckname=('ck'+(index+1)+(value.id));
  24.                                      console.log($("input[name='"+ckname+"'").offset().left)
  25.                                      console.log($("input[name='"+ckname+"'").offset().top)
  26.                                   cursor.style.left = $("input[name='"+ckname+"'").offset().left+"px";
  27.                                           cursor.style.top =  $("input[name='"+ckname+"'").offset().top+"px";
  28.                              $("input[name='"+ckname+"'").eq(value.scoresAnswer).attr("checked",'true');
  29.                              var $wrapper = $('#slimtest4');     // 父级容器
  30.                                                   var $target =$("input[name='"+ckname+"'");    // 目标元素
  31.                                                   $wrapper.scrollTop($target.offset().top - $wrapper.offset().top + $wrapper.scrollTop()-150)
  32.                                          $("#slimtest4").perfectScrollbar('update');
  33.                             },1000);
  34.                        
  35.                     });
  36.                                        
  37.                                        
  38.                                        
  39.                                         setTimeout(function() {
  40.                                                 $('#slimtest4').scrollTop(0);
  41.                                 }, 500);
  42.                                        
  43.                                        
  44.                                        
  45.                                        
  46.                                        
  47.                                        
  48.                                        
  49.                                        
  50.                                 var ckLength=that.questions.length;
  51.                                         var cursor = document.getElementById("cursor");
  52.                     var currentIndex=1;
  53.                     var interval=setInterval(function () {
  54.                                                 var $target =$('#ck'+currentIndex);    // 目标元素
  55.                                                 $wrapper.scrollTop($target.offset().top - $wrapper.offset().top + $wrapper.scrollTop()-150)
  56.                                                 currentIndex=currentIndex+1;
  57.                                                
  58.                                                 if(currentIndex>ckLength){
  59.                                                         clearInterval(interval );
  60.                                                 }
  61.                                                  
  62.                             var finalPositionX = $target.left ;
  63.                             var finalPositionY = $target.top ;
  64.                             cursor.style.left =  finalPositionX+"px";
  65.                                         cursor.style.top =  finalPositionY+"px";
  66.                                },1000);




















  67.        var cursor = document.getElementById("cursor");
  68.                     var btn2 = document.getElementById("ck1");
  69.                     var rect = btn2.getBoundingClientRect();
  70.                     var finalPositionX = rect.left ;
  71.                     var finalPositionY = rect.top ;
  72.                   
  73.                                 cursor.style.left =  finalPositionX+"px";
  74.                                 cursor.style.top =  finalPositionY+"px";


  75.                                        
  76.                                        
  77.                                        
  78.                                        
  79.                                        
  80.                                        
复制代码

回复 显示全部楼层 道具 举报

您需要登录后才可以回帖 登录 | 立即注册

QQ|Archiver|手机版|小黑屋|JeeGit 官方论坛 ( 吉ICP备19001578号-2|吉B2-20200006 )

GMT+8, 2024-4-26 09:25 , Processed in 0.033169 second(s), 17 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表