combine « selector « jQuery Q&A

Home
jQuery Q&A
1.addClass
2.alert
3.array
4.attribute
5.browser
6.callback
7.clone
8.Cookie
9.Date
10.Development
11.document
12.dom
13.element
14.filter
15.Firefox
16.flash
17.format
18.html
19.input
20.internet explorer
21.json
22.mootools
23.page
24.performance
25.regex
26.safari
27.selector
28.setTimeout
29.String
30.table
31.Text
32.trigger
33.URL
34.video
35.xml
jQuery Q&A » selector » combine 

1. JQuery: combine two jq selectors    stackoverflow.com

Im sure the solution is simple but I cant figure it out :( I need to combine two jquery selectors in one selector:

$(this) + $('input[type=text]:first')
$(this) is e.g div#selected so the result should ...

2. Newbie query: how do I match combined selectors with jQuery?    stackoverflow.com

I've sussed how to use YQL and jquery to pull in and inject HTML into a div element. However, I want to filter out a div with the class in the HTML ...

3. combine jquery calls into 1 function    stackoverflow.com

I have the following jquery which animates on hover:

        $('#footerNetwork').hover(function(){
            $('#popupNetwork').animate({top:'-62px'},{queue:true,duration:500});
   ...

4. Is it possible to combine functions for different selectors like this in jquery?    stackoverflow.com

Just another silly thought for jquery. Is it possible to do something like this in Jquery: Instead of typing all three like this:

$('#id1').click(function(){
$('#idanother1').animate({height:'100px'},450);
$('#id1').toggleClass('my-added-class');
});

$('#id2').click(function(){
$('#idanother2').animate({height:'100px'},450);
$('#id2').toggleClass('my-added-class');
});

$('#id3').click(function(){
$('#idanother3').animate({height:'100px'},450);
$('#id3').toggleClass('my-added-class');
});
I would like to be able to write it something ...

5. How do I combine 'this' with a first-child selector?    stackoverflow.com

I'm trying to combine 'this' with div:first-child to get the html value of a hidden div that makes up the body of an anchor tag. How should this work?

$('a').click( function(){
 ...

6. combine two jquery select statements    stackoverflow.com

how can i merge the results of two select statments with jquery? for example i have

var previous = $(this).prev('td');
var next = $(this).next('td');
how do i then combine the two sets of results ...

7. combine jQuery statements    stackoverflow.com

I'm having a brain dead kind of day and I'm trying to figure out a way to make this smaller and everything I've tried has not worked. I know ...

8. how to combine two selectors?    stackoverflow.com

in my example http://jsfiddle.net/radek/HnXC4/2/ I defined jQuery handler for click

  • on button
  • that have a class run
via $(":button, .run").click(function(){ how come the this button should NOT work button's clicked ...

9. Can I combine jQuery selectors?    stackoverflow.com

I want to do the following:

$("#dat_chk" + (i)).css("background-color", "#f6FFee");
$("#dat_opt" + (i)).css("background-color", "#f6FFee");
$("#dat_txt" + (i)).css("background-color", "#f6FFee");
Is these way I can shorten to just one select with jQuery?

10. JQuery combine selectors    stackoverflow.com

I have a Javascript that I am working on and I would like to combine two selectors so that they refer to this tag only:

<input name="checkable" type="checkbox">
So that only checkable with ...

11. How can I combine JQuery selectors and variables to shorten code for easier scaleability?    stackoverflow.com

I have this piece of javascript that is working.

var footerColour = $.color.extract($("div#one.footer"), 'background-color');
var newrgba = $.color.parse(footerColour).add('a', -0.5).toString()
$("div#one.footer").css("background-color", ''+ newrgba +'');

var navColour = $.color.extract($("div#two.nav"), 'background-color');
var newrgba1 = $.color.parse(navColour).add('a', -0.5).toString()
$("div#two.nav").css("background-color", ''+ newrgba1 +'');
It ...

12. Multiple attrbiute selector combined with has selector    forum.jquery.com

I have a table with checkboxes in each row. Now, only if a row is selected, I need to validate certain fields in that row as I might have hundreds of rows and it would take an aweful amount of time if I had to iterate through all of them and then validate if checked.

13. Combined selector    forum.jquery.com

14. Combining "this" and advanced selectors    forum.jquery.com

15. [jQuery] Multi Combined Selectors    forum.jquery.com

hi all. i'm new here and i hope posting in right place. I'd like toask if and how I can add multicombined selectors like:$(this).parent().parent().$("input:checkbox[class='list']").attr('checked')I know that the $("input:checkbox[ppb='list']") isn't right but i justwant to show you what i want to do.I'm already inside a selector:$("input:button[name='delete']").click(function() { if ($(this).parent().parent().$("input:checkbox[class='list']").attr('checked')) { //dosomething}});is this posible?thanks in advanceN.

16. [jQuery] Combining Selectors    forum.jquery.com

To help troubleshoot, take jQuery out of the picture and replace your alertwith:alert( this + " input[type='submit']" );That will make it clear what the problem is.Since concatenating "this" to a string doesn't work, how do you fix it? Usethe second argument to the $ function:$( selector, context )Like this:alert( $( " input[type='submit']", this ).attr('id') );-Mike

18. Combining selectors    forum.jquery.com

Is there a way to combine selectors? My code is getting pretty messy when it's all really just the same thing. //These all do the same thing, only the selector changes //Is there a way to make it cleaner by combining them all? $('#mploader_women1 a').fancybox({'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true}); ...

19. [jQuery] Combining selectors    forum.jquery.com

I need help in this compound selector problem. I have the followingjQuery statements, which are working: $("input[@type='button']").addClass("button"); $("input[@type='submit']").addClass("button"); $("input[@type='reset']").addClass("button");I want to combine them into a single statement, such as: $("input[@type='button' or @type='submit' or@type='reset']").addClass("button");or $("input[@type='button'] or input[@type='submit'] orinput[@type='reset']").addClass("button");similar to the Boolean OR that XPATH expresssion allows, but it doesnot work. What is the proper syntax, if the combining is possible?

20. jquery combine this and class selector    devnetwork.net

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.