jquery

jQuery - Select / List Menu HTML

I have a select menu right now that holds over 100 options. the height is set to about 50px or so... so there is quite a bit of scrolling.. i was trying to use a list menu, and it was way too long... can i use jQuery or pure CSS to create a list menu that is set height width and use scrollbar..? does overflow-y work for all browsers...

Javascript throws an "is undefined" error.

I've been working with Javascript and recently I've been stucked with an error which I can't solve. The Firefox console throws an "info[last] is undefined" error, and I've got no idea what is causing that. Here is the code, the line which provokes the trouble is number 7: $("textarea").each(function() { var id = $(this).parents("div.ar...

JQUERY Click events for multiple Images

I'm creating an image gallery just for fun to expand my introductory knowledge of JQUERY. The gallery has a bunch of thumbnails which, when clicked on, will show a large image just below in an image viewer div. In addition, when a thumbnail is active (image is being viewed) the thumbnail animates from 75px to 100px. I've got it working ...

jQuery nth child trouble

Hi, I'm trying to wrap every set of three .item divs in a larger div, how can I do that? Original: <div class="item">..</div> <div class="item">..</div> <div class="item">..</div> <div class="item">..</div> <div class="item">..</div> <div class="item">..</div> After jQuery: <div class="row"> <div class="item">..</div> <div ...

Any way to update original page's input fields with lightbox radio button selection? (jquery, iframe)

Hi there - I don't know that this is actually possible with my current setup. There are three fields: Current pass, new pass, and repeat new pass. (By request) All I'm trying to get it to do is, when a user wants to update their password but enters identical info in the old and new pass fields, a lightbox pops up asking if they want to ...

Nested jQuery.each() - continue/break

Consider the following code: var sentences = [ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'Vivamus aliquet nisl quis velit ornare tempor.', 'Cras sit amet neque ante, eu ultrices est.', 'Integer id lectus id nunc venenatis gravida nec eget dolor.', 'Suspendisse imperdiet turpi...

HTML Preview via JavaScript or JQuery

I'd like to throw together a quick HTML preview window that takes the contents of a text area and shows it in a modal dialogue with a single close button. The contents should be rendered as HTML. Not sure how to go about this.. what's the best way? ...

jQuery $.post fires twice?

I have this code, and for some reason my $.post function fires twice in quick succession (for 'journal/weather') according to Firebug. It still does this when I remove the "if (navigator.geolocation)", however, if I replace the $.post block with something like console.log('test'), it only fires once. What's even weirder is when I place...

jQuery trigger on variable change

Hi, I have a setup where i load many modules as required, each module has a specific load needs when a specific variable is changed. I need something like jquery trigger but that runs when a variable change, something like this: var x = 0; // no triggers // something happens x = 1; // will trigger a function x = 2; // will trigger th...

loop through returned json using jquery

I am getting image and hyperlink information returned in the JSON. I'd like to use the cycle plugin if possible. Example: [["1.jpg","http:\/\/www.this.net\/"],["2.jpg","http:\/\/www.that.net\/"],["3.jpg","http:\/\/www.what.com/l"]] When my html page is first loaded it will already have this: <div id="container"><a id="changeLink" ...

Sorting not working with datatables.net

Hi I have a datatable that has sorting enabled. It seems though if I try to delete a row then add the new version of that row. Or just try to update that row no sorting will be done on this new/updated row. It is like it is not part of the sort anymore. If I click on the column that row will either be the first or last row. It is like ...

jQuery UI AutoComplete Passing input data

I am sure this has been asked a ton of times, but would appreciate some assistance. I am trying to setup the jQuery UI, which I can get a static result list with from JSON. But I need to pass my INPUT value onto the PHP script to that it can actually filter the results. My Code for the Input Field <input id="search" /> My Code for...

jQuery modal does not update in IE

Hi, I cannot get the following code to work in IE8, it works fine in Firefox. A user clicks a link to add a property to their favourites list. When clicked I use jQuery to load the page into a modal. If they click the same link again the code needs to rerun so it will display "already added". In IE it just displays the original modal w...

Something like a Map<String, Object> I can use to store data in jquery?

Hi, I have some JSON objects I'd like to store in a map for the lifetime of my app. For example, my app shows a listing of Farms. When a user clicks one of the Farm links, I download a Farm representation as JSON: Farm 1 Farm 2 ... Farm N every time the user clicks one of those links, I download the entire Farm object. Instead, I'd l...

jquery css selector to addClass to divs with background image of...

I'm working on an advanced map application in Google Maps API V3. I'm using an array of lettered markers for the pins on the map (A-J). I've written some jQuery to grab add a different class to each div that contains the marker as a background image so that I can animate the markers. Here's the code I'm using to do this: $('.markersHold...

jQuery/JavaScript - Hide / Show Drop down box pending on Radio Button

Hi everyone, I want to make it so that the drop-down is only displayed when the radio button (option 3) is clicked and have it hidden if either 1 or 2 is selected. What would be the best way to complete this? I have a little bit of experience with JavaScript and slim to none with jQuery but it seemed like it might be the way to go. Than...

jQuery Ajax How Do I Pass responseText as variable to indexOf?

Hello, I am trying to append a p element from the responseText of an Ajax request. Before appending, I would like to see if the responseText already exists in the parent div element text, and not add it if that is the case. The problem is I cannot get indexOf(responseText) to work using the variable responseText. My code works when ...

Slick vs. Sizzle -- Pros and Cons of CSS selector engines

When would I want to use Slick and when would I want to use Sizzle? What are the pros and cons of each as a standalone CSS selector engine? How easily can Slick be used with JQuery? Can Sizzle be used with Mootools? ...

jquery animate running laggy

I am trying to create a flashing arrow. However when I execute this script in different browsers it behaves badly. IE says its out of memory, Chrome lags for a second and then behaves well and in firefox the animation is sticky. Hope someone can work out a way that I can animate a flashing arrow smoothly. Thanks aniPointer($('#arrow'))...

jQuery: Fade Out - Do Something - Fade in Pattern

Hello, I seem to regularly write jQuery code of a pattern similar to this: Fade Out ==> Do Something Behind the Scenes ==> Fade In Illustrated below: /// <reference path="jquery-1.4.2.js" /> /// <reference path="jquery-1.4.2-vsdoc.js" /> /// <reference path="jquery.validate-vsdoc.js" /> var fade = "slow"; $(document).ready(function ...