Showing posts with label jquery-selectors. Show all posts
Showing posts with label jquery-selectors. Show all posts

Friday, June 1, 2012

jQuery selector regular expressions


I am after documentation on using wildcard or regular expressions (not sure on the exact terminology) with a jQuery selector.

Tuesday, May 29, 2012

How can I get which radio is selected via jQuery?


I have two radio buttons and want to post the value of the selected one, how can I get the value with jQuery?

Friday, May 25, 2012

$(this) selector and children?


I'd like to use a selector to select the child img of the div I'm clicking on this example:

Sunday, May 13, 2012

jquery selector to count the number of visible table rows?


I've got this html:




<table>
<tr style="display:table-row"><td>blah</td></tr>
<tr style="display:none"><td>blah</td></tr>
<tr style="display:none"><td>blah</td></tr>
<tr style="display:table-row"><td>blah</td></tr>
<tr style="display:table-row"><td>blah</td></tr>
</table>

Tuesday, May 1, 2012

Why "select&rdquo; options are hidden?


I have a HTML select like this:




<select name="something">
<option value="a">1</option>
<option value="b">2</option>
<option value="c">3</option>
</select>

Tuesday, April 17, 2012

Which is more efficient: .parent().parent().parent() ~or~ parents(".foo&rdquo;) ~or~ closest(".foo&rdquo;)


I have an A tag which triggers the animation of it's great-great-great-grandparent. All of the following will work, but which is most efficient, and why?

jQuery :contains selector to search for multiple strings


Assuming i have:




<li id="1">Mary</li>
<li id="2">John, Mary, Dave</li>
<li id="3">John, Dave, Mary</li>
<li id="4">John</li>

Wednesday, January 18, 2012

Setting the id of a link based on it"s href



$('.portfolioThumbs ul li a').mouseover(
function(){
var buttLink = $(this).attr('href')
var buttLinkArray = buttLink.split( '/' ); // Split the URL after each / and Create an array of each
var pFN = buttLinkArray[2]; // We want the Portfolio Folder Name
var url = window.location.pathname;

$('.galleryNav ul li a').removeClass('hovered');
$('.galleryNav ul li a' + '#' + pFN).addClass('hovered');
window.location.pathname = url + '#' + pFN;
}
);