jquery

Stand-alone animate function (like Jquery)

Hi all, I am currently using JQuery to perform a single task: animation of width on a div. I really hate to be loading in the entire JQuery library for this single task and was wondering if anyone knew how to do a standalone function like: div.animate('56'); Where 56 is the percentage of the width I'd like the div to animate to. If...

Using jquery sortable or droppable to put items into categories?

I am trying to place products in to cateogories, like <ul id="Category1"></ul> <ul id="Category2"></ul> <ul id="Available"> <li id="prod1">Product1</li> <li id="prod2">Product2</li> </ul> I want to drop the available products in to a category and when its dropped to post the update back via ajax. It doesn't really matter what is po...

Using Jquery Scroll Follow plugin with Cookie plugin

I'm using the Jquery Scroll Follow plugin to allow a box to follow along as a user scrolls down the website. Scroll Follow allows users to disable or enable the scrolling feature and uses the cookie plugin to remember the users choice across pages. Scroll Follow works great, but the code enables scrolling right away when a user first ...

Updating DOM element with AJAX return data fails in jQuery

I'm doing a simple AJAX post request in jQuery to another page on my site to get an XML document response. I'm putting the response into a pre element with syntax highlighting enabled. The response comes through fine (I can alert it), but it isn't being added to thepre element when I attempt to assign it in the handlResponse function wit...

JQuery Slideshow Choppy in IE

I have created a slideshow using JQuery, and it works greate in all browser except, of course, IE. I'm not worried about IE6 or 7 right now, but even in IE8, the transition animations are very choppy. Does anyone have any idea what the solution could be? This is very smooth in Firefox, Safari and Opera: http://www.pfconrey.com/wedding...

jQuery spikes CPU in Firefox

I got quite a few jQuery scripts in my js file, and now I'm experiencing the CPU going through the roof when I open the page in Firefox. Looking at Firebugs console panel, I see the following error: too much recursion. Then it refers to my jquery-1.3.2.min.js file. How can I discover which jQuery function triggers the CPU spike? I kn...

Why do $.getJSON and $.ajax both return immediately in IE?

I am trying to make an asynchronous request to get some data from my server. This all works perfectly well in Firefox but in Internet Explorer, the callback is being called immediately, before any data is received. $.ajax({ url: "charts.php", data: { site: site, start: toDateString(start), end: toDateString(end) }, cache: f...

How to use JQuery to get information about certain tag?

For example, one of them has this: <div id="hat" re="mouse" > text here </div> $(.#hat).re = ?????? ...

Capture text selected on a web page (a la politico.com)

I'd like to be able to figure out the text that a user highlights on a given web page (we use jQuery if that helps), to capture and store in a database. Politico.com does this in a pretty slick way -- if you highlight text on an article page there and copy it, you copy not just the highlighted text but also a link back to the politico.c...

some jQuery/javascript help. Add items to optgroup

I have an array called tmp var tmp = ["05", "13", "27"]; if an option value is equal to a value within tmp, I want to add that option to a particular optgroup, else add it to the other optgroup. I keep getting everything added to optgroup #2, except the option with the value "27". What am I doing incorrectly? var groups = $("opt...

jquery & php poll in Blogger

Would it be possible to use a poll like this in Blogger? Link: http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-dynamic-poll-with-jquery-and-php/ ...

Load jQuery through Google API in Rails using HAML?

This feels like it should be pretty simple, but not much seems to be loading. I have this in my app/views/layouts/application.html.haml: = javascript_include_tag 'http://www.google.com/jsapi' %script{ :type => "text/javascript", :charset => "utf-8" } //<![CDATA[ google.load("jquery", "1.3.2"); google.load("jqueryui", "1.7.2"); ...

jquery call to javascript function inside LIVE Never occurs

I am doing an AJAX call that returns some HTML and jQuery: <div id='selected'>Here is my Selection Text <a id='trashSelected' href=\"javascript:void(0);\">Remove</a> </div> <script> $('#trashSelected').live('click',function delete() { // remove the container $('#selected').remove(); sub...

Set timeout on jQuery .load

I want to have a timeout after 5 seconds and then display "Unable to fetch page". But im not sure how to go about it... Heres what I got so far... $(document).ready(function() { $('#content').html('<br><br><br><br><img src="load.gif" border="0"><br><br><strong>Generating Link...</strong>'); $("#content").load("ajax....

jqGrid - How to remove the page selection on the pager but keep the buttons?

I want to remove the paging buttons on the grid, but I want to keep the add, edit, refresh, etc buttons on the bottom left. I don't want the pager there because I will be displaying all records in this particular grid implementation. I want to keep what is in GREEN but remove what is in RED: Currently, my solution is to empty out the...

When I do JQuery ".html"..this updates the div's innerHTML.

What if I want to APPEND to it instead of completely replacing it? ...

Javascript using Jquery! looping and printing value

Hi, Suppose I have this: <div id="apple" class="fruit"></div> <div id="orange" class="fruit"></div> <div id="grape" class="fruit"></div> <div id="pear" class="fruit"></div> How do I write a javascript function that can loop and print out all the fruit IDs with class "fruit"? Using JQuery. ...

Filtering By More Than One Attribute in JQuery

Hi everyone, I am just wondering whether that is a correct syntax in JQuery : var elements = $("#contact-area input[type=text,value=something] ").get(); What I mean is how to write specify more than one parameter to and filter apart from this use : $("#contact-area (input[type=text],input[value=something])").get(); ...

Why doesn't Jquery let me do this

document.getElementById("main").src = '02.jpg'; works but $('#main').src = '02.jpg'; doesn't ...

How to send multiple arguments to jquery click function?

Currently I'm using something like: $('.myclass').click(function(){ var msg = $(this).attr('id'); alert(msg) }); And HTML: < a href="#" class="myclass" id="101">Link</a> If I need additional parameters how would I read them? Also is the current way I am using the proper way? Originally I was using hidden input fields so...