jquery

jQuery – Adding a class at/after a specific point in scroll, with variable-length content above

Hi all, Fairly new to jQuery and JavaScript in general. I mocked up an example of my problem at http://jsbin.com/alibi3/2/ - with an explanation below. I have a div that, after a user scrolls past a certain point on the page, is assigned a class of "fixed" so it follows the user down the page. This works fine on its own. Problem is, t...

Using the Ends With jquery selector and get the options of a listbox

Hi, I have the following code: $("input[id$=UserField_hiddenSpanData],input[title=Title]").each(function(){ var rb = $('#ctl00_m_g_c6ae303a_6013_4adb_8057_63a214bcfd24_ctl00_ctl04_ctl07_ctl00_ctl00_ctl04_ctl00_ctl00_SelectResult option').length; var val = $(this).val(); if(val != 0 && val.length != 0 && rb != 0) { ...

jquery sselect checkbox1 when checkbox2 or checkbox3 are seleted

How can I say if you click on checkbox2 or checkbox3 and select one of them, then force checkbox1 to be selected as well $('input:checkbox').click(function() { if ($(this).attr('class') == 'checkbox2' || $(this).attr('class') == 'checkbox3') { if($(this).attr('checked',true)) { $(this).parent()..... } } }); <T...

Binding multiple events of the same type?

Firstly, is it possible? Been struggling with this one for hours; I think the reason my events aren't firing is because one event is unbinding/overwriting the other. I want to bind two change events to the same element. How can I do that? As per request, here's the function I'm struggling with: (function($) { $.fn.cascade = funct...

Convert String to Array with Javasript?

I've got some Data being returned by an API that is formatted in a string, I want to convert it to an array so I can pick values out of it. Comes in like the following: images/20100819_202433.jpg{ "permalink": "http://burstn.com/sayhi#burst/06d67eed55d05dd545583de5b4ca3556", "total_comments": "0", "caption": "", "created_at": "2010-...

how to embed the whole <body> into a created new div with jQuery?

I want to wrap all Body content into a <div>, not including the <body> tag, details, change files DOM from <html> <body>i'm a body</body> <p>i'm out of body</p> </html> to (just put all inside of body into one div) <html> <body> <div id='bodyContainer'> i'm a body </div> <div id='foot...

Using the jQuery spritely plugin's .pan() to skip in between a defined space

OK, sorry for the awkward title! It's kind of a unique situation in my opinion. So basically, with the jQuery plugin Spritely, it's possible to call a .pan() method/action which allows you to (self-explanatory really) pan something across the screen. I currently have three video game scenes panning from left to right and visa versa in...

jquery - Is $(document).ready necessary?

Hello all, I am reading an online tutorial that says if the <script></script> is right on top of </body> the $(document).ready is not necessary b/c the document has been loaded at that moment. Q1> Is that true? Q2> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"&gt;&lt;/script&gt; <script src="jquery.viewpo...

JQuery Validation Plugin: How do I get it to revalidate.

The site: http://tinyurl.com/358lh6a I want to revalidate the palace address (domain they are wanting, form is: Name) whenever the DomainSelect (the domain extention) is changed in anyway. I tried just a simple: <select id=DomainSelect name=DomainSelect onChange="$('#Register').validate().element('#Name');"> It didn't work though. I...

How do you do something before $.get() is submitted?

Hi there, I've got some basic code with jquery: $.get("/booking.php", { event_id: event_id, time_id: time_id }, function(data) { $('#booking_box_content').html(data); }); Which works a treat. Thing is, i'd like to do something before the actual get command is sent. I know the above code is the shorthand, and I know how to do th...

My AJAX tabs callback function is getting huge... Need some guidance.

I'm using jQuery UI tabs to display a few pages of a pretty big form my users have to fill out. The form is, unfortunately, Web 2.0. It has the 'Add more' buttons to add extra inputs to the array, there's one tab that utilizes jQuery UI's draggable() functionality as a kind of 'add more alternative'. Basically, there's a lot of Javascri...

how to display moving elapsed time in jQuery?

Hi, let's say im returning a datetime string like this in JS: "8/18/2010 9:35:27 AM" I would like to have a function that displays an elapsed time based on the current date-time in this format: "x days x mins and x secs" is there a faster way to do this in jQuery? thanks! ...

Jquery slider problem

www.ninjaparadise.co.cc/ check the slider it slides two times to the right but once you slide back to left it messes up, any suggestions? http://ninjaparadise.co.cc/wp-content/uploads/2010/08/shiny-slideshow.js ...

$(document).ready(function() VS $(function(){

Possible Duplicate: what is difference of $(function(){ }); and $(document).ready(function() { }) ;? what are the differences between $(document).ready(function() vs $(function(){ and should I write it in the $ form or the new jQuery(document).ready(function(){ way? if I have google api loaded is google.setOnLoadCallback(fun...

Jquery animate when another animation is in progress

Hi All, I'm using a simple easing animation given here using JQUERY EASING PLUGIN i.e.easing a div from left:200 to left:0 and back.(last example on above page) I have multiple divs in a container div.and what i want to do is animate the 4 divs in following way : 1] Suppose if i have two divs, div1 and div2. when div1 is animated,and ...

JQuery -How to fadeOut instead of Sliding up?

I have 2 sections called .about-us and .price-list. With 2 buttons that activates them .prices and .about-us-btn. The 2 sections both are hidden by default with JQuery and have a .slideToggle event for each, if one is visible though, it'll slide up if I click the other button for it. Now I figured, instead of sliding back up, they can d...

jQuery ui slider wrong values?

Example code: http://jsbin.com/eqile3/ This is a slider with 2 handles, 1 for min and 1 for max and on the slide event these values are put in the input fields. Notice that when sliding the min-handle up and down, the min value is 11 (eventhough I set it to 10), but when sliding up from the min-position it goes from 11 to 10 and then 1...

Jquery + Dynamically filter table data

Hi, I have a table developed using jtemplates. The table has 5 columns. Lets say C1....C5. I need to have a filter below each header which can filter the table data. There are a lot of plugins to do this and currently I am using PicNet table filter : http://www.picnet.com.au/picnet_table_filter.html The trouble is, that whenever the u...

Parent child combo box

Hi I want to implement child parent combo box(country state like if we select any country the state combo box should be populated according to selected country) in my form with jquery. Please give any suggestion how to implement this Thanks ...

adding a variable Number to div position in jquery?

I got the following code to work with .animate, but it won't with standard css properties, could anyone tell me why? var xMove = 200; $("#clickhere").click(function() { $("#object").css({left: '+='+xMove}); }); Got a few similar working approaches now and learnt a bit about syntax along the way, good show people, Ta! ...