jquery

Animation in jquery similar to marquee

Hi friends, I want to move more than one ball image in alternative behavior of HTML.(exactly like the screen saver ball m If i use marquee tag means, it doesn't cross each other. Both moving around separately with the div. It should move around the div and if i place more than one image, those both images should cross each other.. ...

String manipulation in jQuery

I have a div which collapses clicking on a text header. I want to change the header from "+ filters" to "- filters" accordingly (when the div is collapsed or expanded) How can I perform this with jQuery: if (headerDiv.text() starts with "+") replace "+" with "-" else replace "-" with "+" ? ...

jQuery dropdown - CSS issues

Hey, if you to go: http://catonthecouchproductions.com/fish/ and those images under the dropdown are suppose to be hidden then appear on hover, I have this so far: $(document).ready(function() { $('.btn-fishing-trip').hover(function() { $('.fishing-trip').slideDown("slow"); }, function() { $('.fishing-trip').slideUp("s...

Can you do this using jquery?

Is it possible to do this from within a class? $("#" + field).click(this.validate); So basically I want to pass a function of the object that should be executed whenever something is clicked. Also, if there are more than 1 instances of this object, then the correct instance (i.e the one which runs this code for the given field) sho...

How to stop flash content shine-through JQuery UI Dialog in FF Windows

I'm using the jQuery UI dialog box, in IE & FF on Windows I'm getting underlying flash content shining through the dialog box. I resolved this on IE by enabling the bgiframe option on the jQuery dialog window and changing the bgiframe script to apply to any windows browsers, however I'm still getting the shine-through on FF. Note that ...

How do i get the position of a child element

i need to find the position of a child element. i have a table and when a td is clicked, i want the position of the td(0,1 or 2) <table> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> and a script like this <script> $("td").click(function(){ //how do i get the position of the td? alert("collumn " + columnPos...

DRY up js.erb files (include another js.erb file)

Hello, Most of my js.erb files contains something like this at the bottom: $("#flash_message").html("<%= escape_javascript(content_tag(:p, flash[:note], :class => "note")) %>"); $("#flash_message").fadeOut(2000); $("#loading").remove(); I would like to move these lines into a seperate file and then call that file from each of my js.e...

Need help understanding jQuery .val() function

alert("data going into $hidden: " + selected.data[1]); hidden.val(selected.data[1]); alert("data now in $hidden: " + $hidden.val()); What would be a reason that $hidden.val() in the last line above would return undefined? I have verified that selected.data[1] contains an integer value. Edit #1: Some additional context per comments:...

How do I insert a new TR into the MIDDLE of a HTML table using JQuery?

I know how to append a new row to a table using JQuery: var newRow = $("<tr>..."</tr>"); $("#mytable tbody").append(newRow); The question is how do I create a new row that precedes some existing row. ...

Legacy ASP.NET 1.1 with jQuery integration problem

I am working on a legacy web application written in VB.NET for ASP.NET 1.1. One particular page has a form with a number of fields. In response to a drop down box changing value, I am clearing a number of fields, resetting a number of drop down boxes to the first option, and setting them all to "disabled" in the UI. To do this, I'm us...

How can I apply jQuery statements to elements that are loaded in runtime?

I have a web page with one button and one div If you click this button that will load another button into the div using jQuery I found that the new button -which is loaded in runtime - will not be effected by other jQuery statements. how can I apply jQuery statements to elements that are loaded in runtime? I wish It is clear! if not ...

How to navigate href in anchor tag via JavaScript

Is there an easy way to have JavaScript mimic a User clicking an anchor tag on a page? That means the Referrer Url needs to be set. Just setting the document.location.href doesn't set the Referrer Url. <script> $(document).ready(function () { $("a").click(); }); </script> <a href="http://example.com"&gt;Go here</a> This doesn't...

How to — callback functions

Hi guys. I have a big problem writing a small piece of code using JS/jQuery (don't know which of these is causing the problem). Anyhow, here we go: $('#themePicker').unbind().click(function() { var t = $(this); modalwindow2(t, function() { console.log(1); }, function(w) { console.log(w); }); return false...

jQuery equivalent selectors

Are the following exactly equivalent? Which idiom do you use and why? $('#form1 .edit-field :input') $('#form1 .edit-field').find(':input') $('.edit-field :input', '#form1') $(':input', '#form1 .edit-field') ...

Saving raw html of a dynamically created page

I'm writing an application that would allow users to edit a calendar, its description and a few other things. I'm using jquery, php and mysql. Each time the user makes a change it asynchronously updates the database. I'd like to give them the option of turning what they make into a pdf. Is there a way that I can post to my server the ra...

jQuery selector question. Select all nodes that do NOT START with (string)

Trying to assemble a rather complex jQuery selector here, and having trouble. Essentially, I'm trying to grab all anchors that that 1) do not have a "rel" of "facebox", and OR 2) do not have an "href" that begins with "mailto". This is what I've been trying to do: $('a[rel!=facebox], a[href!^="mailto"]') Small variations of this don...

jQuery Slide Toggle Not Working - Resolved

On the first click, it works as expected: the class is changed and the html content is changed from 'Show...' to 'Close...' the content area is expanded with the slideDown effect, Good so far. On the second click, ... the class changes the html content is changed from 'Close...' to 'Show...' The content area does NOT go away as e...

jQuery need to set variable's value from the value of a form input box

I am looking to grab the value of a form input. I think my problem is on this line: var vid = $(this).next(".pid").val(); I need to send the value of the input box named 'pid' to a php page, however there are several forms on the page, all with input boxes named 'pid'. When i merely have: next(".pid").val(); the value that is ...

jQuery DataTables table width problem

I have a problem controlling the width of a table using the jQuery DataTables plugin. The table is supposed to be 100% of the container width, but ends up being an arbitrary width, rather less than the container width. Suggestions appreciated The table declaration looks like this <table id="querytableDatasets" class="display" cellspa...

How can I "filter" JSON for unique key name/value pairs?

I've got some JSON data that is giving me a list of languages with info like lat/lng, etc. It also contains a group value that I'm using for icons--and I want to build a legend with it. The JSON looks something like this: {"markers":[{"language":"Hungarian","group":"a", "value":"yes"}, {"language":"English", "group":"a", "value":"yes"},...