I'm working on a dropdown menu and need to mutate the existing html markup with JQuery to make it fit the design.
Here is a simplified example:
Wrap all "ul's" that contain more than one "li" in a div (in the same div, NOT one div for each UL).
<ul>
<li>foo</li>
</ul>
<ul>
<li>foo</li>
<li>foo</li>
</ul>
<ul>
<li>foo</l...
Hi,
i am having an add to basket problem.Some products have options like color/size. I draw the select box for color/size and an input for qty.
<select name="productOption[1234][color]">
<select name="productOption[1234][size]">
<input type="text" name="productOption[1234][qty]">
So option is an array that holds the values for each p...
Hi All,
I have jQuery, FireFox, Firebug, IE, and IE developer toolbar. When I am examing a page with either FireBug or IE Dev toolbar, I am able to click on an element and it shows me in the dom where the element is etc... Is there anyway to transform that selection into a valid jQuery selector? I know I can use ID, classes, and element ...
Hiya,
I have the following code:
$(".perf-row").click(function(e) {
if (e.target.tagName.toLowerCase() == "a") {
pageTracker._trackPageview($(this).attr("rel"));
return true; //link clicked
} else {
window.open($(this).attr("rel"));return false;
}
});
to the conditional statment of if (e.target.tagName.toLowerCase() ...
Hi,
I am developing a special type of view controller for an iPhone component library.
I have got the who view controller working well, but I need to change it so that it works in one of two ways:
Either it is an abstract class which you must subclass and provider the implementation for a specific method which the controller will call...
Hey all,
The title on this one may be a bit misleading as it's not as simple as it sounds. I've got a page with two tables (each has 50 rows) shown side-by-side so that the rows align with one another. The problem I'm facing is that the default height for a row in each table is the same but occaisionally dynamic content in the second ...
I'm trying to validate my inputs with jQuery before a form is sent.
This is what my input fields look like when there is no value inserted in the database:
<input
class="field"
type="text"
style="background-color: rgb(255, 255, 255);"
value="" name="input_18748_388_1257894000_"/>
This is what my input fiel...
Given that this is the correct way to see if 'this' has class 'selected':
if ($(this).hasClass('selected')) {
// logic goes here
}
What is the correct way to test for the absence of a class?
That is, how can I test if 'this' does not have class 'selected'?
...
i see there is this syntax for detecting any button click
<script type="text/javascript">
$(document).ready(function() {
$(":button").click(function(event) {
alert("Thanks for visiting!" + this.value);
});
});
</script>
but what if i want to only detect a particular button on the...
Is there a way I can use a jQuery pseudo selector like :empty or :not(:checked) on an input/textarea/select element, or any other way I can return an object that is empty?
...
Hi,
I have the following drop down menu:
<select id="target">
<option value="0">Zero ($123.45)</option>
<option value="1">One ($99.99)</option>
<option value="2">Two ($4.50)</option>
</select>
Using jQuery, how can I select the contents of the selected option's () brackets, i.e. 123.45, 99.99 or 4.50?
So far I have:
$("...
Using this statement calls the selector immediately instead of 6 seconds from now.
this.PerformSelector(myStartWaitForSoundSelector, null, 6.0f);
Does anyone know how to get this to work with a delay? I am using thread.Sleep(6000) in the function that gets called, but the entire app locks up for six seconds.
Thanks
...
I've got some links that I want to select class and id at the same time.
This is because I've got 2 different behaviours. When a class of links got one class name they behave in one way, when the same clas of links got another class name they behave differently. The class names are switch with jquery.
So I have to be able to select a l...
I'm improving a checkout page and have 2 identical 'country select' menus. One at the top of the page to calculate postage, and one at the bottom for entering delivery address. Our customers seem to have a lot of difficulty grasping that they need to pick the same country in both menus, or the price calculation will be incorrect.
So wha...
Is it possible to select the last 5 child divs of an element?
...
How many times have we seen this type of selector:
I was just about to start creating this in a WinForms app, when I thought that others may have some ideas for doing this better. We need it to sort - so the right hand list will need up/down buttons. But this seems so old school. I love devexpress components, and was thinking of as...
My problem is that I have a table, but I only want a subset of the rows, from first index to last index. I thought you could do it like this:
$('table tr:gt(2):lt(5)');
I thought it would give you only rows #3 and #4 but it ends up giving you more than that. How can I tell the selector to choose only rows #3 and #4?
...
Hi,
I want to add class to <a>, what has some url. For exampe :
$(document).ready(function() {
var pathname = window.location.pathname;
$(".navholder ul li a").each(function() {
$(this).addClass('sel');
});
});
I want to add "sel" class to <a> what has href=pathname.
Theoretically something like this :...
How to select and apply style on a specific line of text?
Like the CSS pseudo-element :first-line, but I want to select any line, not limited to the first.
It seems that it can't be done by using only CSS... Anyway I don't mind a JS solution.
Update:
Well, actually it's only for interest. I'm trying to achieve something like highli...
I have several objects on a page and I want to perform an operation using jQuery only on some of them - the ones that don't have a specified attribute. So:
<li style='...'>some text</li>
<li style='...'>some other text</li>
<li>some very diffrent text</li>
and in javascript I would have:
$('li[style]').hide();
that would hide all e...