Click-a-picture-to-Hide

点击图片隐藏它 click a picture to Hide it

  1. // ==UserScript==
  2. // @name Click-a-picture-to-Hide
  3. // @namespace https://www.hornmiclink.com/
  4. // @version 1.0.1
  5. // @description 点击图片隐藏它 click a picture to Hide it
  6. // @author Tsuihan@163.com
  7. // @require https://cdn.staticfile.org/jquery/2.0.0/jquery.min.js
  8. // @match *://*/*
  9. // @icon https://web-generate.oss-accelerate.aliyuncs.com//temp/HJSMshortcuticon_1653040529394.png
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. //updated @ 230905 8:48
  15. $(function($){
  16. //添加界面 //alert(window.location.hostname);
  17. var node = document.createElement("div");
  18. node.id = "uiDiv";
  19. //node.className = "uiDivCCS";
  20. node.style.cssText = "position:fixed; top:80px; left:0px; z-index=2147483647; padding:6px; border-radius:6px; font-size:12px;"
  21. +" background-color:#329CC0; opacity: 0.88; text-align:center; "
  22. //node.style.position ="fixed"; //node.style.top = 10; //node.style.left = 100; //node.style.z-index= 999;
  23. node.innerHTML ="<button id='hideBtn' title='click to HIDE all images'>Hide</button> or "+
  24. "<button id='showBtn' title='click to SHOW all images'>Show</button><br> all images" +
  25. "<br><button id='closeBtn' title='click to Close this menu. And press F2 to reload this tool.' width=80% >&nbsp;X&nbsp;</button>"
  26. //document.body.appendChild(node);
  27. document.documentElement.appendChild(node);
  28. node.title="Please contact Tsuihan@163.com to get more. Thanks.";
  29. //为hideBtn添加click事件
  30. document.querySelector("#hideBtn").addEventListener("click",hideBtnDo);
  31. document.querySelector("#showBtn").addEventListener("click",showBtnDo);
  32. document.querySelector("#closeBtn").addEventListener("click",closeMyself);
  33.  
  34.  
  35. //点击图片隐藏它
  36. $("img").click(
  37. function(){
  38. $(this).hide();
  39. console.log("Click-a-picture-to-Hide点击图片隐藏它-调试@230815")
  40. }) //end of .click
  41.  
  42. var hasHided = 0; //是否隐藏的标记,默认为0(unhided status);
  43. $("body").keyup(function(event){
  44. //按下F2则显/隐主界面(Show the main UI)
  45. //alert("Key: " + event.which);
  46. if (event.which==113){
  47. if (hasHided==0){
  48. closeMyself();
  49. hasHided=1;
  50. }
  51. else {
  52. showUI();
  53. hasHided=0;
  54. }
  55. //按下F2则Show or Hide主界面(Show/Hide the main UI)
  56. }
  57. });// end of .keyup
  58. })();
  59.  
  60. //click #hideBtn BUTTON
  61. function hideBtnDo(){
  62. //select by DOM Name:img - select all images
  63. $("img").hide();//隐藏所有图片
  64. }
  65. //click #showBtn BUTTON
  66. function showBtnDo(){
  67. $("img").show();//显示所有图片 //select by DOM Name:img - select all images
  68. }
  69. //click #closeBtn to HIDE #uiDiv
  70. function closeMyself(){
  71. $("#uiDiv").hide();//关闭当前界面(hide it)//select by #ID
  72. }
  73. //click #closeBtn to HIDE #uiDiv
  74. function showUI(){
  75. $("#uiDiv").show();//显示主界面(Show the main UI)
  76. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址