Is there a way to select all elements that have a given style using JavaScript?
Eg, I want all absolutely positioned elements on a page.
I would assume it is easier to find elements by style where the style is explicitly declared:
the style is non-inherited (such as positioning)
the style is not the default (as would be position:sta...
When would I want to use Slick and when would I want to use Sizzle? What are the pros and cons of each as a standalone CSS selector engine? How easily can Slick be used with JQuery? Can Sizzle be used with Mootools?
...
I am trying to initiate a function when a click event happens on a link within a list. This is for a menu.
Right now, I have this and it works:
$(".left-navigation-holder li a:has(~ul)").click(toggleMenu);
Basically, the click event initiate toggleMenu if the link clicked has a list (ul) down the tree. Now, I would also have this to ...
Whenever my method sets an object to onTouchEventReceiver, it gets lost when another method is called by another thread.
//In header
id onTouchEventReceiver;
SEL onTouchSelector;
- (void) setOnTouchSelector:(SEL)sel withObject:(id)obj
{
NSLog(@"setting obj to %@",obj);
onTouchSelector = sel;
[self setOnTouchEventReceiver:ob...
I've got some code on my site that displays a list of articles on a blog as follows (there will be multiple objects with the same category):
<ul class="article category1">
<li> etc
<li>
</ul>
<ul class="article category2">
<li> etc
<li>
</ul>
<ul class="article category3">
<li> etc
<li>
</ul>
I've got some jQuery cod...
Hi,
Normally, i'm using Modernizr for regular feature detection but it can't detect browser selector support (i.e: :nth-of-type() selector).
Is there a way to detect selector support of browser with jQuery?
...
Is there a selector in jQuery that will allow me to select all anchor tags that have a href beginning with href="/products/index?page="?
My full href is href="/products/index?page=2", but they all have the beginning in common.
...
Hi guys. Is there any way to test if a selector would match a given DOM Element? Preferably, without the use of an external library like Sizzle. This is for a library and I would like to minimize the amount of third party plugins required for the "core" library. If it ends up requiring Sizzle I'll just add that as a plugin to the librar...
I am taking the value of a select element and trying to modify it so that I can have access to the onscreen preview element that the select item represents. Here is the first part of the code...
$("#single_area_select").change(function(){
var $element = '#preview_' + $("#single_area_select").val().toLowerCase();
elementC...
<ul id="someList">
<li id="listItem1">List 1</li>
<li id="listItem2">List 2</li>
</ul>
Maybe I need to brush up on my selectors, but how would you grab the first ID of ul#someList?
Also if I'm prepending LI's to ul#someList, will I need to grab the first LI's ID in a different way?
...
Hey guys, thanks in advance for any help or input. I am having trouble understanding CSS selectors and i have read the docs..
I am trying to refer to the UL with the id dropdown in my stylesheet. I was under the assumption that i was able to refer to any elements like:
#dropdown ul
{
}
This method however does not seem to work :s...
Hi all,
I tried to search on net but I couldn't find any jquery simulators.
By simulator I mean a page where I can write jquery code and see what it's executing, what is selected, how jquery selectors work etc.
Is there anything similar on net?
Thanx
Marko
...
Well, I finally decided to totally drop IE6. It's great. First big benefit which comes with this decision is child selectors. So I started to use them for my nested drop-down menus for the first time and expected it to be a breeze. But... here's the code:
<style>
body {
color:#000;
}
ul.top > li {
color:red;
}
<ul class="...
Hi,
I have a few buttons in my view which work as a slideshow, every few seconds buttons change their appearance. On button click I open UIWebView and load a page, I need to change the target (url) of each button when they change their appearance.
What is the easiest way to do it? I can't change buttons' tags as my slideshow based on t...
Hi all,
Which is better practice?
.listing { some attributes:some values;}
applied to multiple locations (e.g. search results, category listing)
or
.search-list,
.category-list,
.other-list { some attributes:some values;}
It seems to me that the second option provides
more flexibility for future changes to style without chan...
I think this is a pretty simple question but I'm having trouble finding the answer out there...
I'm developing an android application (currently developing against v1.5 API) and one of the activities use a ListView. I want to be able to set the properties of each List Item based on the state of an in memory object rather than the state ...
I have a <table> that the data is separated per 2 <tr>'s
So i want to style the rows(each 2 rows) as zebra stripped, but each set of 2 should be styled.
I am trying something like:
tr:nth-child(3n+1), tr:nth-child(4n+1){background:#f7f7f7;}
I would prefer a CSS3 solution, but if only jQuery can do it, that will be fine.
Please see...
I use jQuery.
I have been reading a lot about selector performance and optimizing our AJAX app. I am looking to improve my selector performance. I know all the jquery performance tips. I haven't found an exact answer to a question I have. I am using almost every current jquery performance tip and yet my app still seems to lag quite a bi...
Hi,
This is how to bind multiple events on a couple jQuery selectors:
$('#selector1,.selector2').bind('event', function (e, ui) {
// Stuff
});
But! How do you bind on predeclared jQuery objects. Example:
var jSelector1 = $('#selector1');
var jSelector2 = $('.selector2');
Because, the following doesn't work:
jSelector1,jSelec...
I have a set of dynamic headings and hidden divs with the idea that when the user clicks on a heading it toggles the div underneath to show/hide
the divs all have an id in the form "div_x" where x is dynamically generated
Ive managed to use .each() to loop over all divs that begin with div_ and I can .split the x portion of the id, but...