this code bellow works fine
$('html').bind('mousewheel', function(event, delta) {
window.parent.scrollBy(-120 * delta,0);
return false;
});
but this one doesn't, can anyone tell me why. I'd love to know.
$(window.parent).bind('mousewheel', function(event, delta) {
window.parent.scrollBy(-120 * de...
This is my first post on stackoverflow, hello everyone!
My first venture into jQuery animation is to have a set of images in two divs, top-half and bottom-half, and make them rotate through with a flip-down transition a-la the ancient alarm clocks with flip-down numbers.
I've got the animation down, but the problem is having more than...
I would like to select an element inside the td of one of my tables but I don't really understand the syntax.
This is what I tried:
$("table > td:#box")
This is a sample of my table structure:
<div id="main">
<div id="today">
<table id="list" width="100%" cellpadding="4" cellspacing="0" border="0" style="font-size: 10px; border-...
Let's say my HTML may look one of two ways:
Option 1:
<h2>My header
<span class="apple">My Span</span>
</h2>
Option 2:
<h2>My header</h2>
Via jAuery, I want to append a span to either the nested span (if it's there) or to the header directly, resulting in one of these:
Option 1:
<h2>My header
<span class="apple">My Span
...
if you have more than 1 (dynamic) text boxes with the same class name and use jquery to loop through each of said text boxes, can you assume that the order the textboxes are selected in is the same every time?
Example:
Text box 1 value = 1
text box 2 value = 2
text box 3 value = 3
$(".textboxes").each(function(){
alert( $(this).v...
Hi
i have the table below
<tr id="group_1>...</tr>
<tr id="el">...</tr>
<tr id="el">...<tr>
<tr id="group_2"></tr>
<tr id="el">...</tr>
<tr id="group_1>...</tr>
<tr id="el">...</tr>
<tr id="el">...<tr>
I need to find the last TR of each group
$("tr#group_"+groupID).next("tr#el:last").after("ADD NEW TR");
Its not wo...
I need to loop through all table elements, somewhere keeping an index and then loop through all elements inside those tables. Idea is to add information into database about elements inside tables together with their table index.
...
Hi,
Below is html
<div class="radio_tab"><span>Ad View</span>
<ul>
<li>Ad View</li>
<li>Page View</li>
</ul>
</div>
My javascript is
$("div").not('.radio_tab').click(function(){
alert('hi');
});
and also i tried
$("div:not(.radio_tab)").click(function(){
alert('hi');
});
I am showing dropdown on cl...
I am using jQuery and the jQuery Validation plugin to validate inputs. Below is the code. Now there are many inputs named like question1, question2, question3, question4,... How can I place validation on them? I mean how to select them all together?
$(document).ready(function() {
$("#item").validate({
rules: {
ti...
Hi All,
Im kinda new to Jquery, so this might be easy, then again i cant seem to find anything on Google. So here goes.
I basically have this:
<div>
<div id="row1" class="col1" onMouseOver="OnMouseOver(11)">
I dont want to select this
</div>
<div id="row1" class="col2" onMouseOver="OnMouseOver(12)">
I wan...
I am trying to loop through some elements in a form (radios, text boxes, and select boxes) and get the value from each element. I am looping through by the name of each element (I don't think I can use ID because a group of radio buttons all have different IDs, but all have the same name).
Here are 2 selectors that encompass all the el...
Apologies if this has been asked already, I can't find the answer in the jQuery docs.
How would I select all .tooltip classes which have a [title] attribute, and the [title] attribute is not empty?
In other words, select these:
<a href="#" class="tooltip" title="YES">Foo</a>
<span class="tooltip" title="YES">Bar</span>
But not these...
If I have a table as in this example:
<table class="detailView">
<tr>
<td>Value1</td>
<td>value2</td>
</tr>
</table>
How do I style the <tr> and <td> elements only if the table is of class="detailView"?
...
For example:
<input type="text" size="5" id="question'+$qid+'"onKeyUp="checkanswer('+i+')"/></div>
I want to refer to the "question'+$qid+'" element inside the function checkanswer(), how to do it?
Maybe I can do it by onKeyUp="checkanswer('+$qid+')", is there other elegant way to do it?
...
I'd like to be able to define an inline anonymous selector that a selector wherever a selector is needed as an argument.
Is this possible, or do I have to just suck it up and define a method?
Background: In my iPhone application I need to update my UI from another thread. To do this I use performSelectorOnMainThread:withObject:waitUnti...
I have the following scenario:
I have a div = "#div1" which is coded in html. I have populated this div with some data coming from a script service [ which means the "a's" are not there initially], and the data is appended to this div as
<a href=''>data1</a>
<a href=''>data2</a>
I have a jQuery selector like :
$(document).ready(fun...
There are many input radio elements on a web page and each radio element has several options. I want a function to be fired whenever one option of a radio element is checked. How to write the code using Jquery?
One input element looks as follows:
<div class="below">
<input type="radio" value="information" name="option0"/>
information
<i...
How do I do a css selector that selects a div that has the class of "someButton" AND "current"?
.someButton .current { /* select current with the parent div of .someButton, correct? */
Please help me figure this out!
...
For this HTML:
<div id="idName" class="className">
...
</div>
I know this is correct selector syntax:
div.className {...}
div#idName {...}
By mistake I did:
#idName.className {...}
It seams to work but I don't think it's valid. Can anyone confirm if this is valid?
Edit:
To clarify, this id will be on many pages and, depending ...
So I've got this issue with forms generated by Zend Framework.
As we know Zend is using this format for ID of HTML elements, i.e: contactDetails[name],contactDetails[email] etc.
First of all, why Zend is using invalid HTML to generate forms? There should be no brackets [] inside ids, according to W3C:
ID and NAME tokens must begin ...