簡體   English   中英

使用jQuery通過id隱藏div在Greasemonkey中不起作用?

[英]Using jQuery to hide a div by id doesn't work in Greasemonkey?

Newyorker網頁中 ,頂部邊框(顯示“ The Newyorker”)占用了大量空間。
我在“ developer Firefox edition”中打開了該網頁,並使用網頁檢查器發現邊框的div id是mobile-nav-container

那么,以下代碼為什么不起作用?

// ==UserScript==
// @name        newyorker
// @namespace   N
// @include     http://www.newyorker.com/*
// @version     1
// @grant       none
// ==/UserScript==
console.log('Grease monkey start');
$('#mobile-nav-container').hide();
console.log('Grease monkey end');

好像他們在使用$函數做其他事情。 嘗試:

jQuery('#mobile-nav-container').hide();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM