selectors

Hide all LI from a separate UL other than the first

Hello I want hide every LI from a UL other than the first, but the result is that it hides all except the very first LI of all UL's. (I want "show" the first LI of every UL). How can i do that??? <ul> <li>first</li> <li>second</li> </ul> <ul> <li>first</li> <li>second</li> </ul> When i do this only identified th...

Jquery Selecting an element in a div based on text in a span.

The Markup: <div class="day"> <span>1</span> <div class="icon-shop icon-blank"><p class="event-details" id="shop-1"></p></div> <div class="icon-eat icon-blank"><p class="event-details" id="eat-1"></p></div> <div class="icon-fun icon-blank"><p class="event-details" id="fun-1"></p></div> <div class=...

jQuery catch td

Trying to catch td with style: <td style="color: #333;"> Hope this should work, but it doesn't: td:[style='color: #333;'] Any idea? Thanks. ...

Empty file fields

i must check all :file fields, all fields must be not empty. i use code function CheckFiles() { var t = $('.uploadElement:empty').size(); alert(t); } but t return all uploadElement elements count. how to get empty :file fields? sorry my english ...

jQuery: dom insertion selector problem after .get

HI Volks, here is my code block which I want to replace by the ajax respond: <div class="results"> <span id="like9"> <a class="like" rel="ajax.php?id=9" href="#">klick</a> </span> </div> this is how I observe the ajax link: $(document).ready(function() { $('.results .like').click(function() { params = getUrlVars($(t...

Select from "value" to "value"

Hello I have this <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> <div class="item">7</div> <div class="item">8</div> and I want select from item 1 to item 5 and wrap them into an UL, and select 6 to 8 and wrapp them in another...

Why does Socket.Select(...) take IList and not (also) IList<Socket>?

I'm implementing some networking code using the selector pattern in C# / .NET 3.5. However, I was surprised to find that the Select method takes nongeneric IList's rather than IList<Socket>'s. It says clearly in the help documentation though that a list of sockets is expected here and nothing else. Does anyone know why this is the case...

How do I tell jQuery to run a function on one specific web page only?

I have some jQuery code that is on every web page of the site (in the head element). What selector syntax can I use to tell jQuery that a certain function should only run on one page and not all the other pages on the site? Can I specify a page name or URL in the selector somehow? Many Thanks ...

Prototype select class contained in a div

Hi, I would like to use the following function only on the "a" elements contained in the div "myDiv". This is the code I have been using so far: $$('a[class="active"]').each(function(element) { element.removeClassName("active"); }); ...

Jquery: How to find a link in a page based on its href attribute?

Hi Everybody, I am trying to find the first link of my page which url fit to "AAA" (example). I first try to get the links with this href: $('a[href$="AAA"]') Then selec the first one: $('a[href$="AAA"]')[0] Then target the title attribute of this link $('a[href$="AAA"]')[0].attr("title"); But all of this return me "undefi...

difference between img.slider and .slider

hi everyone, I was just curious: whats the difference between img.slider and .slider (when all of my images have class "slider"). I noticed that when i tried to target the images with class name "slider" via writing .slider { margin-top: 10px; } ^ did not work img.slider { margin-top: 10px; } ^ did work. Why is this the case? Th...

IPhone performSelector problem

Hello I have working code: [self performSelector:@selector(doSomething) ]; but when I change this line to: [self performSelector:@selector(doSomething) withObject:nil afterDelay:1.0]; it reports error - unrecognized selector.... could you tell me what is the problem in? thank you ...

Child elements in a list using Cufon

Hi, I'm trying to use Cufon on the parent li tags on a list and just regular text on the sub level items. The problem is cufon is applying it's style to all items. Is there a way to exclude sub level items from Cufon? I've tried .parent li a:not(.parent li ul li a) but it dosn't seem to work ...

Recreating CSS pseudo-classes in jQuery

I am trying to add a little animation with jQuery to my navigation bar. Right now I have the sub menus of the nav bar changing from display:none to display:block with the css :hover pseudo-class. As I said, I am trying to do this with jQuery, so I need to create a selector that was similar to the one I used in my css. The selector I was ...

Dynamic Functions

Ok, well I have sorta of an odd situation. I have a two applications. One is the main application and the other is a helper bundle that is loaded during run time. What I want to do is to call a function defined within the main application from the bundle so that code does not have to be copied over. I have tried setting the header declar...

Contains an element with the target?

Is there any way only using CSS (no script) to check if an element such as a table contains another element such as with the target? I know that you can use the :target pseudo class for elements with the target, but I need the ability to select an element which contains the element with the target. If there's any way to using the :conta...

label first selector

I have this jquery selector $('.accordion label').live('click',function() { alert("hello clicky clicky"); } but if I do this $('.accordion label:first').live('click',function() { alert("hello clicky clicky"); } it targets label of first accordion rather than the first label of every accordion could someone please he...

Writing a simple custom read more on click function for jquery that needs refactoring

I want to be able to reuse the same function many times on one page.. So here's some psuedo-code : $(".read_more").click(function(){ $(this).parents().find(".hidden_text").slideToggle("fast") }); The problem with this code, however, is that it targets every elem on the page matching .hidden_text. Is there a way to combine closest() w...

How to implement jQuery's .not()?

I have code like: document.onmousedown = function(){ alert('test'); } Now, except the element with ID "box", clicking should call this function, i.e. the equivalent of jQuery's .not() selector. The jQuery code would be: $(document).not('#box').mousedown(function(){ alert('test'); }); How can I achieve the same thing witho...

Safari/Chrome does not understand jQuery focus/blur on check boxes..

Here's my javascript: $(".more_info").hide(); $(".checkbox.has_info, .has_info").focus(function(){ $(this).parent().next().next().show("fast"); }); $(".checkbox.has_info, .has_info").blur(function(){ $(this).parent().next().next().hide("fast"); }); Note, that this works perfectly in Firefox/ IE7, IE8. So far I have discovered th...