告诉我另一种写作方式,以便找到第一个A:
$("UL.tab LI A.selected, UL.tab LI A:first-child").corner("tl:7px bl:7px");
Run Code Online (Sandbox Code Playgroud)
因为我的Jquery似乎不是第一个A标签!?
标记:
<ul class="tabNavigation">
<li><a href="#Description" class="selected">Description</a></li>
<li><a href="#Details">Details</a></li>
<li><a href="#Features">Features</a></li>
<li><a href="#SpareParts">Spare Parts</a></li>
<li><a href="#Downloads">Downloads</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud) 我在这个div上有高度自动设置:
div#new-menu-lower ul li ul li ul
Run Code Online (Sandbox Code Playgroud)
我需要一些jquery将相同的高度应用于以下div:
div#new-menu-lower ul li ul
Run Code Online (Sandbox Code Playgroud)
这甚至可能吗?如果你能演示一个非常棒的例子.
提前致谢!
我正在尝试使用jquery创建HTML标记:
<div class="icon"></div>
Run Code Online (Sandbox Code Playgroud)
如果页面上存在youtube视频,则创建以上标记:
if ($('div.container iframe').length) {
alert('frame exists');
$('<div class="icon"></div>');
}
Run Code Online (Sandbox Code Playgroud)
但是它不会创建标记.我希望用户粘贴youtube视频然后我的Jquery应该自动为它们创建图标.请看我的实施:
var $video = $('div.container iframe'); //location of video
var $productImage = $('.product-image'); //location of main prod img
var $icon = $('.icon'); //location of icon
//check if video exists
if ($('div.container iframe').length) {
alert('frame exists');
$('<div class="icon"></div>');
}
$('.product-image').append($video); //append the video to the main prod img
$icon.on('click', function() { //click
$video.toggle(); //toggle the video based on click
});
Run Code Online (Sandbox Code Playgroud)
JSFIDDLE: http ://jsfiddle.net/t7qMF/7/ 解决方案: http ://jsfiddle.net/t7qMF/13/
我正在更新一个Greasemonkey脚本,该脚本href在vBulletin的ignore部分中读取被忽略用户列表中的名称.
我将值存储在一个数组中,然后display:none将td其隐藏在消息板中的被忽略的用户线程中.
执行此操作的唯一方法是访问忽略列表并将数组值存储在其中about:config.但是我无法将数组存储在那里.
以下是更新脚本的相关部分:
// @grant GM_setValue
// ==/UserScript==
(function() {
var allT;
var allR;
var plonk = new Array();
var ignore_threads_from = GM_setValue;
var url = "http://www.site.com/forums/profile.php?do=ignorelist"; //use for iggy list URL
var currentURL = window.location;
if (url == currentURL) {
var GM_setValue = $('#ignorelist.userlist li a').map(function() {
return $(this).text();
}).get();
}
Run Code Online (Sandbox Code Playgroud)