您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
change Baidu search result page into masonry layout
当前为
// ==UserScript== // @name Baidu Masonry // @namespace ChocoY // @version 0.2 // @description change Baidu search result page into masonry layout // @author ChocoY // @match https://www.baidu.com/s* // @icon https://www.google.com/s2/favicons?domain=baidu.com // @grant none // ==/UserScript== (function() { 'use strict'; let content = document.querySelector('#content_left') let left = 40,right = 40 function masonry(){ function placeItem(n){ if(n.nodeName != 'DIV'){ return } n.style.width='calc(50vw - 100px)' n.style.visibility="visible" if(left <= right){ n.style.left = '30px' n.style.top=left + 'px' left += n.offsetHeight + 10 content.style.height = left+'px' } else { n.style.left='calc(50% + 15px)' n.style.top = right + 'px' right +=n.offsetHeight + 10 content.style.height = right + 'px' } } left= 40 right = 40 for(let i =0;i <content.children.length;i++){ placeItem(content.children.item(i)) } } masonry() content.onchange=masonry })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址