In this example (which is working) on click of a button the section is toggled visible/invisible.
Great but what is the code in line 2 actually doing??
I have found a reference to the :eq(0) part here on jQuery.com but the '>' I have no clue. Under firebug it doesn't seem to matter if the '>' is there or not.
$("#btnHideShow").click(fu...
My javascript
$(".controls").click(function(event) {
var div = $(event.target).parents(".controls");
var a = $(div).find("tr .select");
return false;
});
And html
<div id="grid1" class="controls">
<a href="/projekt/create">Add</a>
<a href="/projekt/edit...
I currently have two input fields which toggle the value "value" to either true or false.
What I would like to happen is that when the user hits the submit button, I can run an if/then statement for each input field and pass a different variable for each field, then combine those two variable into one variable.
For example.
if ($('inp...
I would like to determine the number of images inside a certain div. I am fairly sure I have the code to select the elements I would like to count:
var imageCount = $("#work img").size();
And the div itself couldn't be simpler:
<div id="work" class="shown">
<img src="graphics/gallery/001.jpg" />
<img src="graphics/gallery/002.jpg"...
I'm using galleriffic to handle my image gallery and I'm having a problem with the thumbnail active states.
Galleriffic doesn't have support for active states on the images - only the list items. Right now the gallery will assign a "selected" class to the current LI containing the thumbnail and I've been trying to use jQuery to target t...
Hello,
I'm trying to format my list of items, where the html goes like this:
<ul class='product_list'>
<li>Item 1
<ul>
<li>Item 1.1</li>
<li>Item 1.2
<ul>
<li>Item 1.2.1</li>
<li>Item 1.2.2
<ul>
<li>Item 1.2.2.1</li>
...
Hi. I need to replace all the HTML5 video tags on the page with their poster image that has a click event attached; the click event launches a Fancybox containing that video tag. Anyone know how to do this with jQuery? Thank you.
...
Note: If you're 'just' a jQuery developer some things in this post may look a tad complex (Base62 encoding etc.) - it's really not. Although the more technical details are relevant to the question, the core is that jQuery won't select stuff with capitals. Thanks!
Hi folks!
So I have a list generated by Ajax. When you click the list's t...
Hey all, I've been trying to get a series of objects to appear that have multiple classes associated with them
<div class="Foo Bar">
Content
</div>
<script>
alert($('.Foo').length);
</script>
The selector above is returning 0. This is unfortunately one of those questions that is completely impossible to ask to google (at leas...
I have a select list:
<select id='myList'>
<option value="">zero</option>
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select>
How can i set the value of option value to = 0 using jQuery?
I tried $("#myList > option").attr("value", "0");
But thi...
Is it always best practice to use:
var $this = $(this);
Or is $(this) cached and therefore the above line is just for saving two characters?
...
I have a UserControl in MVC which may be repeated many times on the page.
Say I had something like the following:
<div>
<a href="#" class="enableTextBox">edit</a>"
<input type="text" class="comments" readonly="readonly" />
</div>
<div>
<a href="#" class="enableTextBox">edit</a>"
<input type="text" class="comments" rea...
Hey there,
these two selectors is not working in Internet Explorer 8 (they work okay in Firefox, Safari and Chrome).
$(this.children).stop().animate({ color: "#4B2B26" }, 300);
$(this).find('a').stop().animate({ color: "#4B2B26" }, 300);
Help is appreciated, thanks!
edit; I think it's a problem with jquery.js.. Each time i hover a o...
Because Jquery UI tab doesn't support passing id selector to remove() tab method, and no method exists to map id to index, I have to painfully "jump hoops" to determine the index of the tab I wish to remove.
I just searched the documentation for JQuery and wasn't able to find a utility method to return an integer of the ordinal positi...
Hi,
I have a table row elements:
... <tr index="1000" class="class1 classHighlightRed"> ...
... <tr index="1000" class="class1 classHighlightYellow"> ...
I would like to check the value of the second class against some constants.
E.g.
If (2nd class == "classHighlightRed") Then
{
doSomeWork;
}
At the moment...
I want to select an element based on their innertext in JQuery. Below is my Html
<html>
<body>
<a href="fddf">4</a>
<a href="fddf">4</a>
<a href="fddf">4</a>
</body>
</html>
I want to select all the <a> tags which has text of "4". Any idea how do I do it?
...
I'm tying to select images based on their URLs, but for some reason it's not playing ball:
Ultimately I'm after something like:
var imgs = $("img[@src='images/object.png']:not(:hidden)");
But even with something simple like:
$("img[@src='images/object.png']");
This error is thrown: "TypeError: Object doesn't support this property ...
I'm using jQuery to manipulate table rows that are paired within a table. I'm trying to select rows based on found items from my previous jQuery where if the row contains a visible image, I need that row and it's next sibling. I can get the row using:
$("img[src*='file.png']:not(:hidden)").closest("tr");
Because I'm also after the s...
This is my HTML page.. If you copy paste this complete HTML in a browser you would see that the second section has Elements and Duration while the third section has Elements and targeted resources, In this case i want to dynamically change the 2nd and 3rd row to expand like the first one.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Tran...
Ive made a 'hover with sticky click' jquery script for my web portfolio which works in Chrome, Opera, Firefox, and Safari - but I'm still having some problems with IE.
I have 8 thumbnails that fade between 0.3 and 1 opacity on hover. When clicked it uses the index of the thumbnail to show the corresponding full size image. It also is li...