jquery

Is this how you define a function in jquery?

Is this how you define a function in jQuery? $(document).ready( function () { var MyBlah = function($blah) { alert($blah); }; }); Now to call the function I do: MyBlah('hello'); ...

Jquery Multiple Sortable List

Can someone please explain how to take the code below. Heres a screen shot this is my JS $(document).ready(function(){ $(function() { $("#sortable1, #sortable2").sortable( { connectWith: '.connectedSortable', opacity: 0.6, cursor: 'move', update: function() { var order = $(this).sortable(...

Need a jQuery Lightbox plugin that supports $.live() and grouping

I'm bringing in all of my images via Ajax, and I'm looking for a quick fix for the front-end of this project. I've tried a couple of jQuery lightbox plugins, but I can't seem to get them to perform in a live function (correct me if I'm wrong in thinking I need to do this). Currently attempting to use Balupton's Lightbox Plugin (can't li...

jQuery - Sortable with divs

Is it possible to sort div layers? Examples only show list items being sorted. I currently use one function to control dynamically created divs (based on a MySQL result). This one function keeps the movable layers in one div. ...

path error in jquery call to cakephp controller/action

I know, strange title.... this is my problem: I have the cakephp stack in /var/www/site from one view under controller A I do a jquery ajax call: $("#searchstring").autocomplete("/items/getitemsforautocomplete", { ... more code when the call is triggered I can see from firebug that cakephp wants to call: http://localhost/items/g...

How do I PUT data to Rails using JQuery

Hi, I am trying to send a jquery ajax PUT request that looks like this: $.ajax({ type: "PUT", url: '/admin/pages/1.json', data: { page : {...} }, dataType: 'json', success: function(msg) { alert( "Data Saved: " + msg ); } }); but I get the following error: The er...

How do I PUT JSON data to Rails using JQuery?

Hi, I am trying to send a jquery ajax PUT request that looks like this: $.ajax({ type: "PUT", url: '/admin/pages/1.json', data: { page : {...} }, dataType: 'json', success: function(msg) { alert( "Data Saved: " + msg ); } }); and my controller looks roughly like this: respond_to do |...

jQuery UI multiple selections

Hello see this demo from jquery ui you have to hold down the Ctrl key to make multiple selections I really like the code but I don't want to force my visitor to press ctrl key I want the code to allow multiple selections without holding ctrl key is this possible? ...

jquery UI dialog open is mind-numbingly slow in IE7

Have a large amount of HTML, but where I thought the bottleneck would be is incorrect: it's when I'm opening the dialog, not when I'm building the string of HTML (~35ms), nor when I'm appending it to the dialog container div (~50ms). When calling dialog("open") below In FF, I'm consistently getting 1800+ ms, IE7 is around 17000(!) ms. ...

How to pass multiple checkboxes using jQuery ajax post

Hello How to pass multiple checkboxes using jQuery ajax post this is the ajax function function submit_form(){ $.post("ajax.php", { selectedcheckboxes:user_ids, confirm:"true" }, function(data){ $("#lightbox").html(data); }); } and this is my form <form> <input type='checkbox' name='user_ids[]' value='1'id='checkbox_1' /...

jQuery+AJAX delete anchor not working

Hi I'm using jQuery and Codeigniter. I'm creating a simple todo list that can add delete entries using ajax. The problem is whenever I click on my delete anchor, it won't delete the entry. The adding of the entry feature works BTW. Here's my code: todo_view.php <html> <head>Todo List</head> <script type="text/javascript" src=...

jqgrid ASP.NET MVC -- getting data right for the grid.

Here is my dilemma, I have not been able to manipulate my data to a form fitting to jqgrid standards. This is my first time using the jqgrid and I've spent a lot of time reading up on it. My js code is as follows: jQuery("#list").jqGrid({ url: '/Home/ListContacts/', dataType: "json", conten...

strange behavior using $('.ajax_form').ajaxForm();

It is my first time to apply jquery ajaxForm on a class like the following <form class="ajax_form"...><input type="text" name="q" /><input type="submit" /></form> <form class="ajax_form"...><input type="text" name="q" /><input type="submit" /></form> <script> $('.ajax_form').ajaxForm({ dataType: 'json', error: ajaxErrorHandler, s...

Hide/show table columns with jQuery

I'm currently working on a new Magento template, and I'm facing problems with jQuery. My current code for app/design/frontend/default/blank/template/catalog/product/list.phtml is similar to follows (the page is hosted here: http://nordschleife.metaforix.net/118/118/index.php/panasonic.html) <table border="1"> <tr> <th width="178"...

jquery callbacks being called multiple times

When I use the fade/slide/animate functions in jQuery the callback gets called multiple times for each element the effect is applied to. This is by design of course. I just want to know when the last callback is called. Here is what I came up with- it fades out all the divs and displays an alert() when the last callback is fired. $(...

How to save the order for jQuery UI portlet plugin?

Hello I am using the portlet plugin from jQuery UI my question is: is it possible to save the order of the portlets in the database so when the user come back he can see his portlets sorted in the same order?How? Thanks ...

jQuery to Prototype convert: Dynamically SlideUp div on mouseover

Hi, I use this jQuery code to slide up a div over its wraper div dinamically: jQuery.fn.masque = function(classSelector) { $(this).hover(function(){ $(this).find(classSelector).stop().animate({height:'88px',opacity: '0.8'},400); },function () { $(this).find(classSelector).stop().animate({height:'0',opacity: '0'}, 300);...

jQuery loop though two levels of elements

I have some html that looks like this: <div class="block"> <div id="item1"></div> <div id="item2"></div> </div> <div class="block"> <div id="item3"></div> </div> I'm trying to check to see if my div will contain a specific element. I need to loop though each block, then get each item. What I've got so far $('.block...

JQuery IE jerky slide animation

Hi, I have the following code to animate the showing/hiding of a div. $(".headerClosed, .headerOpen").live("click", function(){ $(this).next().slideToggle("slow"); } This shows and hides a div with the following markup: <div class="details"> <p>Date</p> <p>Text</p> </div> The problem is in IE(surprise, surprise!) when the di...

Jquery delayed css div position

I am trying to make my menu bar partially hide after a timeout of about 5 seconds of inactivity. The menu is positioned 20px from the top of the page and the basic idea is that a small section of the menu will still be visible once it has moved up to allow the user to hover over this for it to drop down again (hopefully this makes sense!...