English 中文(简体)
是否围绕这一 j子开展了工作?
原标题:Is there a work around for this jQuery bug?
$( > img[src="folderopen.gif"] ,$scope)

以上情况将失败,如果周围有工作,就会出现ug。

这个问题在这里:

如何判断是否有特定的儿童(只有经过测试的婴儿)和孩子?

http://www.ohchr.org。

我刚刚核实这一点也将失败:

$scope.children(  img[src="folderopen.gif"] );
最佳回答

Tested, and Works:

Demo Online: http://jsbin.com/uyuri3

<p id="scope"> 
  <img src="foo.jpg" /> 
</p>

------

$(function(){
  var scope = $("#scope");
  alert( $(scope).children("img[src$= foo.jpg ]").attr("src") );
});

——————————

var img = $("> img[src$= foo.jpg ]", scope);

An Interesting Bug

我们知道,我们的<代码>src 数值为<条码>foo.jpg,但下列内容未能做到:

$("img[src= foo.jpg ]");

因此,如果对<条码>src的解释 j,我就很奇怪。 相当于以超文本形式提供的插图一:

$("img", scope).attr("src") === "foo.jpg"; // true

这使整个局势非常奇怪。 j Query辩称,src 数值为NOT,等于“foo.jpg”在你作为甄选人的一部分通过时,但IS等于在您从打电话到attr(时打字的字面值。

最后,$=是达成“foo.jpg”等于“foo.jpg”的协议所必需的。 这当然是一个ug,但并非不可逾越。

问题回答

你应该这样做:

$(scope).children("img[src= folderopen.gif ]");

从这一意义上讲 我假设你会重新做某种树种,如结构(如Windows Exploration)。 如果是的话,我强烈敦促你不要将课堂作为标记,而不要使用归属物选择器,因为多数浏览器的选用器很慢。 例如,与本中心合作:

ul.tree li { background: url(folderclosed.gif); }
ul.tree li.open { background: url(folderopen.gif); }

页: 1

$(scope).children("li.open")...

页: 1





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签