attr

    1熱度

    2回答

    我有這個HTML <a data-overlay="Preparing First" href='#'>First link</a> <a data-overlay="Preparing Second" href='#'>Second link</a> 而且JS $("[data-overlay]").click(function() { var text = $(this).v

    9熱度

    4回答

    ,我首先要給屬性名稱(僅開頭) 例如,選擇屬性值,如果我們有HTML標記 <div class = "slide" data-confirmID = "46" confirmID = "54"/> 開始我要選擇的值從屬性開始data- 在此先感謝您的幫助。

    2熱度

    2回答

    我需要獲取帶有動態生成的ID的div的'角色'屬性。 HTML: <div id="renable0" role="0"> false </div> <div id="renable1" role="1"> true </div> <!-- THE LIST OF DIVS CONTINUES IN INCREASING INCREMENTS OF 1 --> 的J

    0熱度

    2回答

    我怎麼可以在div類.image1 <div class="image1"> <a href="/images/productA.jpg"> </a> </div> 發現HREF鏈接,並將其添加到圖像src這裏的src屬性... <ul class="example"> <li class="GalleryImage1"> <img src="" > </li> </u

    27熱度

    3回答

    我有那種用這種模式的元素: <div data-image="{imageurl}" ...></div> 我想這個元素background-image設置爲data-image。我測試這個CSS代碼:正確 div[data-image] { border: 2px solid black; background-image: attr(data-image url);

    0熱度

    1回答

    我想要動態獲取具有某個屬性的所有子項的索引。我是這樣做的 $("#parent [attribute]:eq(4)"); 但有時「#parent」本身也有屬性,所以我希望得到的是父母的指數爲好,與所有屬性元素的索引。 我試過,但由於某種原因,這是行不通的 $("#parent").find("[attribute]:eq(4)").andSelf();

    0熱度

    2回答

    我正在使用jQuery在圖像的開啓和關閉懸停之間進行切換。這是我的代碼。 HTML <img class="commentImg" src="images/comments.png" data-swap="images/comment_hover.png" alt=""> jQuery的 $(".commentImg").hover(function() { var swap = $

    -3熱度

    2回答

    我正在尋找一個循環,將計算像 1 , 0.8 , 0.6, 0.4 , 0.2 , 0.2 , 0.4 , 0.6 , 0.8 , 1 ,並追加到定製ATTR "data-depth"與li元素i走到這一步,這樣的事情,我不能對 移動 for (var i = 0; i < 5; i++) { $tiles.eq(i).attr('data-depth', -(i*0.2-1));

    -2熱度

    1回答

    所以這裏是我的代碼但我不能讓它工作有人有任何想法我做錯了什麼? function doStuff2() { $("#song").css({ 'background-image': 'url('+id+')', 'background-position': '0px 0px', 'background-size': '100% 100%',

    1熱度

    1回答

    我有子類的偏好,並在attrs.xml創建的自定義styleables如下: <declare-styleable name="MyPreference"> <attr name="myAttribute" format="reference" /> </declare-styleable> ,我可以在XML聲明我的偏好如下: <com.my.project.MyPreferenc