jquery-selectors

Select pseudo-elements with jquery [duplicate]

别来无恙 提交于 2019-12-24 21:39:42
问题 This question already has answers here : Selecting and manipulating CSS pseudo-elements such as ::before and ::after using jQuery (22 answers) Closed 5 years ago . How would you convert this block of css into jquery? .nav li a:first-child:nth-last-child(2):before { content:""; position: absolute; height:0; width: 0; border: 5px solid transparent; top: 50% ; right:5px; } I've tried a couple different ways but nothing I tried worked properly. Where this css selects only before the the jquery

IE everlasting problem with selectors

寵の児 提交于 2019-12-24 20:19:18
问题 I think that i have some problems with jquery selectors in IE. Chrome and Firefox is ok, but not IE. Not only selector from example below not works. Every selectors not works in IE. I am using jquery 1.6.2 and jquery-ui.min 1.8 Example: html: <p id="clickme">clik me</p> jquery: $(function(){ $('#clickme').click(function(){alert('hello')}) }) 回答1: Ok, I have had tons of problems with syntax on IE. Get in the habit of using semi colons. I looked at your JavaScript file and there was quite a few

Retrieving ids of chid divs using jquery?

久未见 提交于 2019-12-24 18:13:01
问题 Please have a look on the code below .. <div id="click_me">Save</div> <div id="blocks_sortable"> <div id="block_1"> <h2>Block 1</h2> <div class="items_sortable connectedSortable"> <div id="item_1"> <span>Item 1</span></div> <div id="item_2"> <span>Item 2</span></div> <div id="item_3"> <span>Item 3</span></div> </div> </div> <div id="block_2"> <h2>Block 2</h2> <div class="items_sortable connectedSortable"> <div id="item_4"> <span>Item 4</span></div> <div id="item_5"> <span>Item 5</span></div>

What is the second argument in this jquery select statement?

*爱你&永不变心* 提交于 2019-12-24 17:05:03
问题 I have seen it here. What is meant by tbl in the following statement? What does it imply? var rows = $('tr', tbl); 回答1: The tbl in the above is another dom element. This is passed in as the (optional parameter) context : jQuery( selector [, context ] ) ...for the selector , in this case 'tr' . source So essentially this: $('tr', tbl); says return me everything that matches the selector 'tr' in the element(s) tbl . Example So given <table> <tr>first</tr> <table> <table id="test"> <tr>second<

wrapAll() only working on the first element?

孤街浪徒 提交于 2019-12-24 14:25:40
问题 I'm using this script to wrap two divs: jQuery: $("#wrapcb").click(function(){ $('#cboxOverlay, #colorbox').wrapAll('<div class="wrapcolorbox">'); }); HTML: <span><a id="wrapcb" href="http://www.example.com/one">First link</a></span> <span><a id="wrapcb" href="http://www.example.com/two">Second link</a></span> <span><a id="wrapcb" href="http://www.example.com/three">Third link</a></span> The weird thing is that this script only works on the first link and all others are being ignored. Any

JQuery object / embed element issue with attr() method

隐身守侯 提交于 2019-12-24 13:04:34
问题 I am trying to exchange the value of this embed element's src value, dependent of the click event. It works in firefox and opera as intended, but not in safari, chrome, or IE. $('.scrollableArea a').click(function() { //retract id from selected anchor, and create + append new video parameter values. var newVideoVal = 'http://www.youtube.com/v/' + $(this).attr("id") + '?version=3&autoplay=1'; $('#gallery_content object param').attr('value', newVideoVal); $('#gallery_content object embed').attr

jQuery problem with selector

拜拜、爱过 提交于 2019-12-24 11:21:14
问题 I have a very strange problem. I am using jQuery to intercept a particular tag click. I have: <a class="question">lorem ipsum</a> <a class="question_selected">lorem ipsum</a> <a class="question">lorem ipsum</a> <a class="question">lorem ipsum</a> And my jQuery is: $("a.question").click(function(){.....}); It should intercept the <a> click where class="question" but it is also intercepting whenever I click <a class="question_selected"> . What can be the problem? EDIT: I am actually changing

OR and AND combinations inside if-statement

萝らか妹 提交于 2019-12-24 10:59:33
问题 I have this selector: $('ul:not(.sub-menu) > li, ul.sub-menu > li:last-child').not(':has(ul.sub-menu)'); which gets these elements: Every direct li descendant whose parent is not .sub-menu (unless it's the last, cf. 2.) Every last li element of an ul.sub-menu Exclude all li 's that are parent to a ul.sub-menu Now, I want to use this in an if-statement, which is inside a hover-function. In other words, it's got to be relative to that list item instead of being the list item. Something like

CSS Issue in JQuery [duplicate]

蓝咒 提交于 2019-12-24 10:03:27
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Why does $('#table > tr') selector not match? (always return 0) I tried to apply color to rows of a table using the following code. It doesn't work, but I don't understand why. Could someone explain why or point me in the right direction? HTML: <table id="tblSample" border="1" cellpadding="0" cellspacing="0" width="300px"> <tr> <td>1</td> <td>1</td> </tr> <tr> <td>2</td> <td>2</td> </tr> </table> JQuery: $("

jQuery XML parsing in IE8

独自空忆成欢 提交于 2019-12-24 09:48:39
问题 I have some XML that I am parsing in jQuery. <payload> <value key="VehicleMake"> <value key="description">Aeon</value> <value key="code">18</value> </value> <value key="VehicleMake"> <value key="description">Alfa Romeo</value> <value key="code">120</value> </value> </payload> In all browsers except IE (specifically IE8) the following works: $.ajax({ type : "GET", async : false, url : "/services/vehiclemake", success : function(xmlResponse) { var data = $("payload", xmlResponse).children(