jquery

Populating div with checkboxes

I use this code to determine checkbox width and height: var chk = $('input[type="checkbox"]:first'); chkWidth = chk.innerWidth() + parseInt(chk.css('margin-left').replace('px', '')) + parseInt(chk.css('margin-right').replace('px', '')); /*IS there better way instead of px replace?? */ chkHeight = chk.innerHeight() + parseIn...

JQuery animation: Is it possible to change speed during the animation?

I want to move a div down a page, and I want it to slow down as it reaches the target. I tried using call back with recursive func but it doesn’t look smooth: function MovePanel() { sidePanel.animate({"marginTop": newCurrTop}, moveSpeed,function(){MovePanel();}); Is it possible to slow down an JQuery animatio...

jQuery table colorize plug in issue

I was wondering if anyone could help me figure out where i may be going wrong. I am using the Table colorize plugin to highlight some table columns depending on which column has been clicked. The table can be swapped in and out with different data via AJAX on clicking some tab links in an unordered list. Basically the plugin works gre...

Fix thead on page scroll

Situation: a page with a table with several rows. I want to fix thead when thead reach the top of the page when scrolling, using jquery or any given scripting. I don't want to overflow the table itself. Thank you! ...

Using an iframe in jquery.simplemodal, the iframe reload when the popup is closed

var pt_popup_options = {}; function pt_popup_iframe(sURL, sOkFunction) { pt_popup_okfunction = sOkFunction; $("#pt_msgBox").css('width', '700px'); $("#pt_msgBox").css('heigth', '500px'); $("#pt_msgBox > p").html('<iframe style="width: 696px; height: 496px;" src="' + sURL + '"></iframe>'); $("#pt_msgBox").modal(pt_pop...

JqTouch - Detect trigger for animation

Yet another problem I'm having w/ jqTouch... I'm trying to detect what element was clicked to trigger an animation so that I can pass parameters from the clicked item to the subsequent page. My HTML is: <div id="places"> <div class="toolbar"> <h1>Places</h1> <a class="back" href="#">Back</a> </div> <ul> <li id="1"><a ...

When select box option is selected, hide and uncheck corresponding checkbox using jQuery

When an option is selected the corresponding checkbox <div> is automatically hidden using jQuery. For example, user selects Item 1 from the select box, and <div class="item1"> is immediately hidden. Caveat: Both will be visible, so the user changing the select option must be accounted for (eg. user selects an option who's corresponding...

jQuery fadeIn() not fading in.

This one has be stumped. I'm adding some HTML to a element and then want to fade it in. However, when implemented, it doesn't fade in. It just 'snaps' in immediately. The syntax/order looks right. Anyone see anything wrong with my logic: $('span.mySpan') // fade out the empty span so it's hidden .fadeOut('fast',function(){ ...

How to copy a variable in JavaScript?

I have this JavaScript code: for (var idx in data) { var row = $("<tr></tr>"); row.click(function() { alert(idx); }); table.append(row); } So I'm looking through an array, dynamically creating rows (the part where I create the cells is omitted as it's not important). Important is that I create a new function which encloses...

jquery php and csv exporting

i have a script for exporting results of a mysql query as a csv file. The thing is that i use jquery to access the script. I need to know how i can return the data (already in csv format) with jquery. In other words, just to make myself clear because my english is a bit poor, when the user presses a button in the html file, a post reques...

jQuery Autocomplete plug-in search configuration

I'm looking into using jQuery autocomplete plug-in to implement user lookup by first or last name. It looks like by default autocomplete looks up words by character sequence no matter its occurrence in a word. So if you have data such as: javascript, asp, haskell and you type in 'as' you will get all three. I would like it to at least m...

Show code demos online

Is any website where I could upload my JQuery/Javascript, CSS, and HTML projects to show demos? I am looking for any free file hosting service to show my demos, has a public download location for those files, and is more than just storing files on their server. I have asked this question because I would be providing links on my wor...

Selecting whole table/text for copying to clipboard

I have a htlm table with lots of data the user might want to copy to paste into Excel or whatever... Since it's big I want to help user selecting it, he can then copy & paste himself. I found this http://stackoverflow.com/questions/2044616/select-a-complete-table-with-javascript-to-be-copied-to-clipboard but it creates a security erro...

Novice with jQuery AJAX

I am simply learing Ajax with jQuery and have a simple page method that takes in a parameter and returns a string. For some reason, I am not getting the return string but I am getting to my 'success' message: $(document).ready(function() { $.ajax({ type: "POST", url: "testFormMatt.aspx/sayHell...

jQuery response is empty in browser, though curl works.

I'm using jQuery's .ajax() to call a server (actually local Django runserver) and get a response. On the server console, I can see that the JSON request comes in, he proper JSON response is made, and everything looks OK. But in my browser (tested on Firefox 3.6 and Safari 4.0.4, and I'm using jQuery 1.4.2), it seems the response body i...

jQuery/JS for different pages - best way of doing this?

Apologies if this is a silly question, and I'm not even sure of the best way of wording it... At the moment I have a site with maybe 20+ different uses of jQuery, all varying from page to page. I'm just wondering what the best way is to store this code? Everything in one big jquery.myfunctions.js file? And check if the element exists ...

Definitive best practice for injecting, manipulating AJAX data

Ever since my foray into AJAX, I've always used the "whatever works" method of manipulating AJAX data returns. I'd like to know what the definitive and modern best practice is for handling data. Is it best practice to generate the HTML via the server script and introduce the returned data on the onComplete function? Should XML/JSON be l...

Will replacing content with jquery cause memory leaks in IE8?

I have a page where I load a table of information using ajax. Once the table is loaded I use jquery to wire up some event handlers on the table's rows. From that page it's possible for the user to refresh that table. My jquery code to refresh the table looks something like this: $.post("/myurl", { id: 0}, function (d) ...

How to change <title> with delay?

I know in jQuery 1.4.x there is a method delay(). We can use it like this: $('#block').slideUp().delay(2000).slideDown(); and it works great. But i want to modify document.title, but this construction doesnt work: $('title').html('New title 1').delay(2000).html('New title 2'); when you run this code title will be New title 2 avoid ...

How to check if any JavaScript event listeners/handlers attached to an element/document?

Tried to search online, but does not look like I can formulate search query properly. So as simple as it sounds, how can I, either with jquery or just javascript list all the handlers or event listeners that are attached to element(s)/document/window or present in dom. Just wondering. Thank you in advance. ...