If I have a view with a performSelector set to fire after a delay:
[self performSelector:@selector(generateBall) withObject:NULL afterDelay:1.5];
...but I removeFromSuperview that view before the selector fires (for example, due to user interaction), then my app crashes.
Is there a way to kill the delayed selector in the dealloc met...
Hi guys, im pretty new to the PHP DomDocument, im reading the documentation right now and im wondering is does exixts some selectors like the ones we seen in jquery.
Well, i exmplain my situation: i have this xml file to parse every day and update a database:
Europe Bank Money Currency
That's a little snapshot:
<gesmes:Envelope>
...
i have a table
<table>
<tr>
<td class="myA">Data...1a</td>
<td class="myA">Data...2a</td>
<td class="myA">Data...3a</td>
</tr>
<tr>
<td class="myB">Data...1b</td>
<td class="myB">Data...2b</td>
<td class="myB">Data...3b</td>
</tr>
<tr>
<td class="myC">Data...1c</td>
<td class="myC">Data...2c</td>
<td class="my...
I've just started using jquery and I'm really enjoying using selectors. It occurs to me that the idiom would be a very nice way to traverse object trees (e.g., JSON query results). For example, if I have an object like this:
var obj = { 'foo': 1, 'bar': 2,
'child': { 'baz': [3, 4, 5] }
};
I would love to be able ...
I have an element that has two classes at all times:
<p class="general_description laptop">
<p class="images laptop">
<p class="specs laptop">
One class describes the item (laptop) and the other (general_description, images, specs) describes the state that the page needs to be in to present one of three types of information about the ...
Given this HTML:
<button id="buttonId1" class="hello universe">
<button id="buttonId2" class="hello world">
What's the correct way to do something like this:
$("#buttonId1").click(function ()
{
alert($("#buttonId1").getClass());
}
I realize the getClass function does not exist in JQuery or Javascript. But I'm hoping there's ...
If I have a button:
<button id="button1">
Normally I would write:
$("#button1").click(function ()
{
//do something
}
But I want to define a function that responds to all click events except when someone clicks on this button.
Is there a selector that would allow me to target all other clickable elements in the document ex...
My Html looks like this:
<a href="#" id="QuoteTest">Click Here</a>
<ul>
<li title="this" style="position:relative">one</li>
<li title="this" style="position:relative">two</li>
<li title="tha't" style="position:relative" >three</li>
<li title="tha't" style="position:relative...
A few days ago I posted this question: http://stackoverflow.com/questions/1169387/switch-statement-and-loops-using-jquery-javascript
which ended up with me creating a series of divs using this code
for (var i = 1; i <= $("#play option:selected").text(); ++i) {
$("#play_"+i).slideDown().find("input").addClass("someClass");
}
...
i am actually doing a accordion/sliding menu. here, i want to slide up sibling li > ul that has been open (or displayed). can i simplify this further?
$(this).parent("li").siblings("li:has(ul)").children("ul").slideUp("fast");
i also noticed that i cannot skip the children() part and do something like
$(this).parent("li").siblings(...
Hi
I know I'm just being OCD about a few milliseconds worth of performance time, but I was just wondering why the following is true for me. It seems goes against my logic.
I currently have a div that has fades out the image inside on hover:
$('div.someclass').hover(function() {
$(this).children('img').fadeOut(function(){
/...
Hi again all jQuery coder
I have a problem with selecting and filtering elements inside a div.
My html looks like this
<div id="wrapper">
<input type="text" value="you can edit me">
<input type="button" value="click me">
</div>
and my jQuery looks like this
$("#wrapper").children().click(function() {
alert("hi there");
...
Okay, I'm not sure how to describe what i want to do concisely. So, take the following pseudo-html:
<input type=checkbox id=chk1 myatr=1 />
<input type=checkbox id=chk2 myatr=1 />
<input type=checkbox id=chk3 myatr=2 />
<input type=checkbox id=chk4 myatr=1 />
<input type=checkbox id=chk5 myatr=2 />
<input type=checkbox id=chk6 myatr=3 ...
It seems elementary, but here is problem.
Stylesheet like so:
#Content h1, #Content h2, #Content h3, #Content h4, #Content h5, #Content h6 {
color: #405679;
}
h3#issueHeader {
color: blue;
}
HTML like so:
<div id="Content">
<h3 id="issueHeader">In This Issue:</h3>
</div>
Instead of my issueHeader selector overriding the Co...
Hi I have a simple modal popup which has 3 name fields and 3 e mail fields adjacent to each other. I am new to jQuery so can any one please help me how to write a logic for the following case?
The first name field and Email field are mandatory so I kept the class as required fields but the other two name and e-mail fields are optional b...
What's the difference between the space and > selectors? And possibly related, how can I look for something that's the direct child of something else, and not lower down the descendant line?
...
Sometimes it is useful to have an empty jQuery object, to be used either as a default value or as an initial value, when constructing a collection of items.
For an example, see here.
One way to do it would be to use a selector which is unlikely to match anything, like $('skdhjfksjdhfksjhdf'), but this is obviously inelegant.
How can I...
I'm reviewing a number of jQuery functions that have various implementations of id selection. I want to try and standardise on one best-practice approach, but before I do that I want to ensure that I pick the most efficient.
Does anyone have links to good articles (such as this one) that make comparisons between different types of sele...
I'm not sure whether to use :first or :eq(0) in a selector. I'm pretty sure that they'll always return the same object, but is one speedier than the other?
I'm sure someone here must have benchmarked these selectors before and I'm not really sure the best way to test if one is faster.
Update: here's the bench I ran:
/* start bench */...
Hi -
I'd like to be able to select a specific option within a dropdown list in order to manipulate it.
For example,
$("#mylist > option14").replaceWith(<option value="option155">New Option</option>
How can I do this?
Selecting through the child selector doens't seem to work.
Thanks.
...