For example, to animate a box from the left, I can set "left" to the negative value of "width", and animate it to zero:
$('.box').each(function(){
$(this)
.css('left', $(this).width()*-1 )
.animate({'left':0},1000)
;
});
Is there a way to do this without the each function? THIS JQUERY IS TOO VERBOSE!
...
Ok here's what I have so far.. thanks to Paolo.
And it works fine, but only if I have existing radio button options.
What if I need to create a NEW radio button without any pre-existing ones?
Ultimately what I want to do is create an array of options, loop through them and output
a list of options as radio buttons. So originally, ther...
I'm using the jQuery plugin ajaxForm to submit a file upload form via AJAX. The script submits the form, which, upon success, runs uploadResponse() that adds a new row into a <table> on the page. It works fine in Opera, Firefox, Safari, IE7, and IE8.
However, IE6 does not run the uploadResponse() after the form has been submitted. Th...
I'm cleaning up a simple form that has a Start Date textbox and an End Date textbox. I want to add a checkbox in between these fields that the user can check if the End Date is the same as the Start Date, so when they check it, the Start Date input value (e.g., 04/01/09) will automagically appear in the End Date textbox, so they don't ha...
However, I want to compress my responses with GZIP wheren possible. I tried using the Compression filter code available for free download in the headfirst site. It works great for html, images, css and javascript.
I post the filter next. It checks if GZIP is an accepted encoding and it adds gzip as Content-Encoding. See: wrappedResp.se...
I currently have an ASP.NET GridView that displays a few columns to the user with one of them being a link to view the details for the specific record. From the details page, the user has the ability to access other pages for adding new records (for example from the contact record page, you can click a link to add a new vehicle purchase...
I have a field that autocompletes on person name, so it has options like "Obama, Barack", "Lincoln, Abe", etc.
These people also have additional attributes, say "Birthplace" and "Phone number". When a user picks an option from the autocomplete, I would like that person's additional attributes to automatically populate hidden form fields...
How can I trigger some action with right click after disabling the browser context menu ?
I tried this . . .
$(document).ready(function(){
$(document).bind("contextmenu",function(e){
return false;
$('.alert').fadeToggle();
});
});
.alert {
visibility: hidden;
}
...
Hi everyone!
I have this situation: I have a page where I have a list of events of a day. And these events can be changed theirs status to 'Confirmed' or 'Cancelled'.
But, when I, for instance, click on 'Confirmed', this status is saved on SQL Server and this status is shown 'Confirmed'. But, if another person has this same page opene...
Seems like $("img").next().hide(); is not working when both the image and div tag are a child of a paragraph.
<p>
<img src="image.jpg" />
<div>text</div> // this div is set to 'display: none' by default in css
</p>
Yet, if I substitute <div> with <span>
<p>
<img src="image.jpg" />
<span>text</span>
</p>
or if I omit the <p> tags
<...
I would like to style all of the radio buttons with the same name in a form easily in a nice Prototype or jQuery-style shortcut.
$('billship').select('name:shipType') or something like that.
Does such a shortcut for form field names exist?
...
I have used a prototype plugin which filters the contents of a dropdown as you type. So for example if you typed 'cat' into the text box, only items containing the substring 'cat' would be left as options in the drop down.
Does anyone know of a jquery plugin which can do this?
...
My code is:
$(document).ready(function() {
$('.post_title').editable('editposttitle.php', {
cancel : 'Cancel',
submit : 'OK',
indicator : 'Saving...',
});
});
When saving text the text'Click to edit' is inserted into my element? instead of the saved text?
Any ideas?
Thanks!
...
Basically I have an xml document and the only thing I know about the document is an attribute name.
Given that information, I have to find out if that attribute name exists, and if it does exist I need to know the attribute value.
for example:
<xmlroot>
<ping zipcode="94588" appincome = "1750" ssn="987654321" sourceid="XX9999" sourc...
I am working on a very simple layout here: http://www.flanels.com/ - If you click work it draws down, I am using this jQuery:
$('#left ul li.item').hover(function() {
$(this).addClass('over');
}, function() {
$(this).removeClass('over');
});
And this is the class:
#left ul li.over{
background-color:#4CC7DC;
}
If yo...
I've got a jQuery date picker control that works fine for once instance, but I'm not sure how to get it to work for multiple instances.
<script type="text/javascript">
$(function() {
$('#my_date').datepicker();
});
</script>
<% Using Html.BeginForm()%>
<% For Each item In Model.MyRecords%>
<%=Html.TextBox("my_date")%> <...
I have a frames page with a header and a body just below it. The header frame is roughly 20px; about the height of a textbox which is exactly what I want. In this upper frame, I have a textbox with an autocomplete attached to it. What is happening is when I search for something in the textbox, the results from the autocomplete are droppi...
Hi Guys,
I tried to create a dropdown menu in JQuery, but it's proving quite difficult.
My code is here:
$(document).ready(function(){
$('ul li').mouseover(function()
{
$(this).children("ul").show();
});
$('ul li ul').mouseover(function()
{
$('ul li ul').show();
...
I have looked at TinyMCE, FCKeditor, YUI Rich Text Editor, NicEdit and some others, but I was wondering if there is one out there that utilises jQuery? I mean, I already use jQuery in all my projects, and it seemed it'd be useful to have a WYSIWYG editor that used it also. This should result in a smaller file size.
I understand if one d...
(I understand that someone else asked a similar question and it was closed as 'argumentative', but I'm really interested in understanding the arguments around this.)
I know JavaScript really well. I've been writing it professionally for years. I've internalized a lot of the cross-browser incompatibilities and sketchiness, know DOM manip...