jquery

Constructing a javascript variable

Here is my jQuery: jQuery( document ).ready( function ( $ ) { $('ul li:first-child').addClass( 'first_item' ); var className = $('.first_item').attr('id'); alert('Date is:'+ className +'.'); }); And then this another section of jQuery, that im trying to contrust a variable in: j(".refreshMe").everyTime(5000, function (i) ...

Switching class between two elements using jQuery

I have two elements with a class name each. And on some event I'd like them to switch class. So basically I'd like to do something like this: $("#div1").switchClassWith("#div2"); <div id="div1" class="someStylingClass">...content...</div> <div id="div2" class="someOtherClass">...content...</div> And this would result in #div1 having ...

Jquery. Execute code only when all iframes are loaded

Hello. $(document).ready(handler) call to handler when page is loaded not paying attention to whether iframes' content is loaded or not. I want code to be executed only when content of all iframes loaded. Is there any way to achieve this? ...

In jQuery, how do I animate the "max-height" CSS property?

I can easily animate the "opacity" property $("#blah").animate({ opactiy: 0.5}, 1000); How can I animate the max-height css property... example: $("#blah").animate({ "max-height": 350}, 1000); (hint, that code doesn't work) EDIT: To answer the questions below: There are multiple images all of css class "blah" The images are of ran...

how to unbind all event using jquery .

i can use this code to remove click event, $('p').unbind('click') but , has some method to remove all event ? has a method named unbindAll in jquery ? thanks ...

Parsing JSON string with jQuery.parseJSON()

So, this should be simple in my mind... I have a valid JSON string being returned through an Ajax post: {"success":true,"message":"Thank you! We value your feedback."} And I'm simply trying to alert my "message" value onto my resulting post return: success: function (result) { alert(result); var obj = $.parseJSON(result); a...

jQuery: is there a bug in how jQuery.ui.sortable ajax:update sends data?

code: http://jsfiddle.net/WRppV/4/ I should get something like "content"=> ["141", ["203", "206", "204", "205"], "142", ["215", "207"]] but i get Parameters: {"action"=>"sort_contents", "content"=>"207,215", "controller"=>"contents"} Which are the last two values in the array.... I should be getting everything shouldn'...

Close FancyBox after action?

I've got some links on my page that when clicked, open a fancybox. Inside the fancybox there are some action buttons (like "close item", "delete item"). When those buttons are clicked, I want it to submit the form as usual, and then close the fancybox. How can I rig it up to do that without interfering with the POST? Note: I'm not using...

How do I create an appropriate array of form elements with jQuery that can be used in a ColdFusion function?

I have a pretty standard contact form that uses a cfc for processing now. I want to use .post for users that have javascript turned on. I've created an array with jQuery of the form elements and I want to pass that to the same CFC (without modifying the CFC) but I'm not certain how to do it. Basically, I want to pass something called 'fo...

request.form issue

is there a way I can get values out of "Request.Form["person"] so I can set some of the values to an Entity? ...

javascript div closing problem

Hello, I have a div that opens when user clicks link. And the div sort hovers over the link (its a more info box/div) and the div has a links and text. Now what I want is that when user cliks outside of the div it closes/disappears. But I want the links inside of div to work. Atm the javascript for that closin is like this: $('html').c...

get location +20px?

$(document).ready(function() { //select all the a tag with name equal to modal $('a[name=popup]').click(function(e) { //Cancel the link behavior e.preventDefault(); //Get the A tag var id = $(this).attr('href'); //Set the popup window to center $(id).css('top', winH/2-$(id).height()/2); $(...

jQuery sortables and how to save the current sorting to mysql

Example I want use this sortables - http://interface.eyecon.ro/demos/sort.html How to save the current layout setting to MySQL? Any clue? ...

jQueryUI Radio/Check buttons not changing programmatically

I can predicably read the value of a jQueryUI radio button, however, I am not able to set it programmatically. No matter which methods I use to change the radio button's value, jQueryUI interface will not update its interface. <div id="radio"> <input type="radio" name="radio" value="true" checked="checked" />Yes <input type="rad...

Get the absolute position of a div relative to the window.

This question is quite similar to what I want I'm looking for, but my situation is different enough, I think, to merit a new question. I have several divs positioned absolutely inside of a parent div (position: relative). I want to get the position of the children divs relative to the window. The jquery offset() method doesn't seem to ...

Two dimensions jquery sortable retrives a bug in IE.

I have two dimensions sorting bug in IE8 and below. IE just doesn't know to handle this thing. As you can see, there are two levels of sorting items. Two dimensions. In all of the browsers this thing works perfect. Only IE get crazy. My code $("#experienciasProfissionais").sortable({ placeholder: 'ui-state-highlight', cur...

Ajax / php - How to return failure

jquery allows for success failure and error responses. How can i return a failure or error manually along with a string that describes the failuer or error? ...

jQuery .wrap() isn't working

I'm probably doing something wrong but I've tried all sorts of things and can't seem to get a collection of jQuery objects wrapped. The following just outputs the link HTML, unwrapped. Any ideas? $.each(sitemapSections, function(i) { var $sitemapSection = $(sitemapSections[i]); var $primary = $sitemapSection.find('a[data-level="1"]'...

:hover property overriden after jquery effect, how to get it back?

I have an animate function... function flashGreen(e) { backg = e.css('backgroundColor'); e.animate({ backgroundColor: "#5ccc96" }, 1000); e.animate({ backgroundColor: backg }, 500); } with a css like so .container { padding:5px; background:#eaeaea; } .container...

Fancybox jQuery from iframe

From one page, I call fancybox to open an iframe in the fancybox. From that page, the one in the fancybox, I try to write some more jQuery code. $(document).ready(function() {}); is not called if my jQuery code is in the head tag, but if my jQuery code is written before anything, even the DOCTYPE, then it works. Why is this? Thanks ...