jquery

JQuery global loading animation

Is there a way to attach a loading gif, using Jquery, anytime any image on my site within a certain div is loading? I would like for it to be a global function, the only way I can seem to figure to do this is using jquery to call a certain link, and then load the loading.gif but that won't work in my situation… Index HTML: <div id="con...

check filename before posting using jquery/ php

Hey. I need jquery to check if my posted filename (up_image) is empty or not. if it's empty i need a div tag to be shown and come with some kind of alert message. if not, just do the $("#submit").submit(); <form action="/profile/" method="post" enctype="multipart/form-data" id="submit"> <p> <label for="up_image">image...

How to post a form with many fields with jQuery?

Though $.ajax() can be used to do ajax things, I don't think its fit for posting values of a big form. How would you post a big form (many fields) without entering all them by hand? ...

Jquery UI Slider - Currently Linear, would like to change formula for display

I am trying to make changes to the JQuery UI Slider. Changing it from linear in its range of number to more formula based. The reason is that we sell diamonds and our range is from .30 carats to 9 carats, however 90% of the buyers want something between .30 to 2, so I would like that range to be the larger part of the slider. Hopefully...

Jquery displaying confirmation dialog on form submit

Hello everyone. I need to display confirmation dialog on image click. Code in "onclick" section of image should be only executed if jquery confirmation dialog returned true. At this point when user clicks on $(".submit_image") - dialog is displayed, but form is still submitted. The logic should be the same for both jquery.alerts plugi...

How can I reliably track mouse enter and leave events?

Various experiments I've carried out indicate that there is no foolproof way of responding to a 'mouseleave' event using jQuery. Two actions appear to not trigger any relevant event: Moving the pointer away from an element very quickly Moving the pointer off the element via some browser chrome (or out the the window entirely) The sec...

Asynchronous jQuery request timing issue

As a learning exercise I've hacked together a script for an SO feature request (for the purposes of this question please ignore the merits or otherwise of that request). In the script I've encountered a technical issue that my limited javascript knowledge can't get past and I'd appreciate suggestions on how to resolve it. To avoid spamm...

cycle plugin with sliding pager?

I have a working cycle script with 6 slides, with the pager fitting perfectly across. If I added more slides how do I get the pager to slide with the current slide, and use that for the arrows (prev/next)? Is this a feature of the jquery cycle plugin? Or do I need to combine it with another? ...

jQuery Not selector causes infinite loop

The following code causes my browsers to crash. For Firefox, i've been given an option whether or not i want to stop jQuery because it was running longer than it should be. div id="divLeaving"> You are about to leave to: <span id="spanLeavingURL"></span> <a id="divLeavingYes" href="#">Yes</a><a id="divLeavingNo" href="#">No</a>...

Best text editor for debugging jquery code

Best text editor for debugging jquery code or creating jquery plugin ...

jQuery method of calculating the correct offsetLeft of an element in a table.

I've been given a table based layout to work on and I need to display some tool tips above some input boxes contained in the table. I can't use any of the offset properties to do this since they all return 1 when the element is contained in a table. Does jQuery or some other library have a way of calculating this? ...

AJAX polling of a URL returning JSON doesn't seem to return fresh responses (using jQuery $.ajax() method)

My project requires polling a certain URL for a JSON response, using AJAX. The first AJAX request that I make alerts the server that I want some JSON content, and it begins building and cacheing a response, sending me back { "status" : "pending" } for each subsequent AJAX request until the JSON is ready. At that point, the response chang...

how can i edit the action of the buttons in the dialog box in jquery?

this code is from the demo of modal confirmation from jquery's site. <script type="text/javascript"> $(function() { $("#dialog").dialog({ bgiframe: true, resizable: false, height:140, modal: true, overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { 'Yes': function() { $(this).dialog('close'); },...

Trying to access JSON menu in another function to build out a left side navigation

Hi All. I am relatively new to Jquery and JSON and this is my first post here, please bear with me. I have a JSON menu string with an array of three items (name, url, id - our internal page id number) and the top level navigation builds out fine. I loop through the top level items and call a recursive function to get the sub menus. ...

Show/Hide multiple DIVs with Select using jQuery

I essentially have the same situation as the person in the following question: Link: how to show/hide divs by select.(jquery) Through extensive searching within Google I was able to come up with several different methods in which people claim their method works. I have yet to get any to work correctly yet. I don't yet know enough about...

Passing dynamic form settings into jQuery AJAX on page load

I have a jQuery AJAX data grid that loads a list of elements from a database. On the page are radio buttons that allow the user to filter the results. These trigger an onClick function that then refreshes the AJAX. This all works fine. Now I need to pre-define the radio settings dynamically in the PHP code and have the AJAX load these ...

how can i make a dialog box from jquery show only after i hit a button?

this code is from the demo of modal confirmation from jquery's site. <script type="text/javascript"> $(function() { $("#dialog").dialog({ bgiframe: true, resizable: false, height:140, modal: true, overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { 'Yes': function() { $(this).dialog('close'); },...

Is passing multiple sets of arguments as an array in JavaScript faster than multiple function calls?

After becoming slightly uncomfortable with multiple calls to the same function, with different parameters (as shown in the dom ready section of the code below), I decided to test out passing the parameters for this function by iterating through an array instead (as shown in mouse_function_two). To my surprise I found that mouse_function_...

jQuery Hover Fade Button with an Active State

I do not want to double post a question; I was trying to post an add-on to my first question that I was looking for additional help. How does one go about this? Here is the original question. jQuery Hover Fade Button with an Active State Was hoping to see if there is a solution to the glitch I found. The problem I am now looking for h...

jQuery Ajax Problems

I'm making a Greasemonkey script for the Runecape forums (Yes runescape! :p) and I'm trying to make something to look up stats. $('.rssc_view_stats').click(function(){ var this_username = $(this).attr('rel'); var stats_box = '<div id="stats_box"></div>'; //alert('looking for the stats of' + this_username); $(this...