A friend and I are creating a card game for the iPhone, and in these early days of the project, I'm developing a Deck class and a Card class to keep up with the cards. I'm wanting to test the shuffle method of the Deck class, but I am not able to show the values of the cards in the Deck class instance. The Deck class has a NSArray of Car...
I'm trying to select an id that changes on different posts of same page. So the they have been given an id="show_posts_{PostID}" - on the final output the {PostID} is replaced with a number. In the function I need to call $('show_posts_XXXXXX') - XXXXXX being the generated ID. I have stored this ID in a variable called postId.
But I ca...
Hi, i'm just starting prototype, i was on jquery before.
I can't find easy examples on the internet about how :
Selecting all elements having the same id on a page
(i'm doing this but it only works for the first element : $('mydiv').hide() )
Selecting a div that is contained in another div by their id.
hiding all elements that have...
Hi,
I use a jquery selector :
$('#menus>ul>li>a')
I'd like to to iterate the selector result without the last one:
$('#menus>ul>li>a').removeLast().each(fct());
Ofcourse the function "removeLast()" doesn't exist, is there an equivalent ?
Thanks.
...
I want to write a select something like...
#window_4 > content > p:eq(0)
I think I have this correct, but I have a few selectors that are all similar but I can't test them all at once.
Am I right in saying this is selecting an element, who is the fist p tag child of a content tag that is a child of a tag with id 'window_4'
If I have...
I have the following code, i'm trying to make a loader appear then the image fade in once it is loaded. I want to make the function reusable so i can just add an image to a div with the loader id and it will work.
I cant figure out how to select the parent loader div from inside the image. the commented line works fine but, i think tha...
Hi all,
i've my method that implement a reverseGeocoder
- (void)reversing {
geoCoder=[[MKReverseGeocoder alloc] initWithCoordinate:locManager.location.coordinate];
geoCoder.delegate=self;
[geoCoder start];
}
i recall reversing in another method with this:
[self performSelector:@selector(reversing) withObject:nil afterDelay:10];...
I have a class called object which has an element called 'level'. I want to get a list of all the different values of level on the page so I can select the highest one.
If I do something like:
$(".object").attr("level")
will that get me a list of values that are the values of the level attribute? I suspect not, but then how do you do ...
I have a method as an NSString *. If it exists, I want to call it, and if not, do nothing.
SEL eventSelector = NSSelectorFromString(eventSelectorStr);
if ([delegate respondsToSelector:eventSelector]) {
[delegate performSelector:eventSelector];
[delegate adapterDidFinishAdRequest:self];
}
else {
// Does not implement selector...
I have a few scattered <p> elements on the aspx page which I am grouping together using a class like so - <p class="instructions" runat="server">
In my code behind, using C# I want to hide these elements, using something like
instructions.Visible = false;
However I realize I can only do this in codebehind if I use ID but this will res...
Hi, I have made this piece of code that makes a roll hover effect on any image you add the class 'simplehover' to it :
//rollover effect on links
$(".simplehover").mouseover(function () {
$(this).attr("src", $(this).attr("src").replace("-off.", "-on."));
}).mouseout(function () {
$(this).attr("src", $(this)...
I would like to select the start and end selector for the prevUntil() or nextUntil() jQuery selector methods. If i implement these methods now, it grabs everything between the two selectors given.
i.e. $('p').prevUntil('h1') will not include the p and h1 element, only those between them. How could I also select the p and h1 elements as ...
Hi all,
I am not an expert at jquery but trying to get a menu to work. Basically, I have a menu made of up to 3 levels of nested lists. The first level has a little arrow has a background image that opens or close when opening the first level list. Any other nested lists don't need to have the background image.
My script opens the menu w...
How can I select the src attr from the zoom span?
$(".gallery span.zoom").click(function() {
// var imgPath = $(this).parent()......attr("src");
// alert(imgPath);
return false;
});
<ul class="gallery">
<li id="li-1">
<img src="002171/tn/001.jpg" alt="image" />
<span class="delete"></span>
...
I don't remember where I heard about it, (I think I was searching up on how selectors worked and it ended up not being exactly the same as a callback function) and I can't confirm it. But more importantly than that, is there a way I could get a list of the function names from another application?
...
Is it possible, given a SEL to generate a string representation of the method it refers to?
For context:
I have an object instance initialized thusly:
-(id) initWithTarget:(id)object action: (SEL)action;
Within the instance I would like to echo the string name of the method referred to by SEL. How do I do that?
...
In jQuery you can select two elements by id like: $('#elem, #elem2');
BUT
What if you have cached the elem and elem2, and what to apply the same method/function to them both?
i.e.
$elem = $('#elem');
$elem2 = $('#elem2');
This obviously wont work:
$($elem, $elem2)
Thanks!
...
Researching specificity I stumbled upon this blog - http://www.htmldog.com/guides/cssadvanced/specificity/
It states that specificity is a point-scoring system for CSS. It tells us that elements are worth 1 point, classes are worth 10 points and IDs are worth 100 points. It also goes on top say that these points are totaled and the ove...
Hey Guys,
I'm basically having a bit of trouble with traversing through an unordered list and retreiving list items.
foreach (MyTypeObject s in result)
{
oList.Clear();
{
oList.AppendFormat("<ul id='OuteroListItems'>");
oList.AppendFormat("<li>");
oList.AppendFo...
Hi, I've been using XPath with Selenium quite happily and even using getEval with a but of Javascript, but a colleague said wouldn't it be great to be able to use JQuery selectors in Selenium.
I've googled it, but can't find any articles that seem to work for me. Could anyone provide a comprehensive guide on how to use JQuery syntax to ...