jquery

jquery Add and Remove Classes?

Hello, I need a script that adds a 2 to the end of a class in a div with the id .sideboxtopleft on clicking of a link with the id of posts. <script> $(".posts").click(function () { if ($('.sideboxtopleft').is('#sideboxtopleft2')) { $('.sideboxtopleft').removeClass('2'); } else{ $('.sideboxtople...

In jQuery, is $('li.item-ii').find('li') the same as $('li.item-ii li')?

In the example of jQuery's find() (the doc is at http://api.jquery.com/find/) I wonder why we need it, because, is $('li.item-ii').find('li') the same as $('li.item-ii li') essentially, all the <li> elements inside the <li> element that has the class item-ii Similarly $('#id1').find(".class1 #id2") is the same as $('#id1 .cl...

Why does the jQuery on this page work for Internet Explorer 8, but nothing else?

I made a web page that uses jQuery: http://benmccormack.com/demo/MichaelMassPsalm/Psalm16Mode5.html When you change the selection in the combo box from Higher Key to Lower Key, all of the music images are supposed to change their source to be images that represent the lower key signature. This works great in IE8, but it won't work in S...

Trying to override onbeforeunload in first step of form wizard

This pertains to a form wizard with 5 steps, I don't want the user to hit back and lose form data in any step 2-4. I have added a flag for the submit function and need to add this one for the first step. If they get there by accident and try and leave I dont want the cofirm dialog popping up. <script type="text/javascript"> $(docume...

Copying one form's values to another form using JQuery

I have a "shipping" form that I want to offer users the ability to copy their input values over to their "billing" form by simply checking a checkbox. I've coded up a solution that works -- but, I'm sort of new to jQuery and wanted some criticism on how I went about achieving this. Is this well done -- any refactorings you'd recommend...

Show loading image when pdf rendering

I am displaying pdf on my page like this <object data="/Customer/GetPricedMaterialPDF?projID=<%= ViewData["ProjectID"]%>" type="application/pdf" width="960" height="900" style="margin-top: -33px;"> <p> It appears you don't have a PDF plugin for this browser. No biggie... you can <a href="/Customer/GetPricedMa...

cannot get thickbox to open / tb_show function ignored

I have two links that should open up thickbox's in iframes but only one works (the one with the id of product_photo_zoom_url2). I have the following jquery code that works when this code (in first code box) s removed from the markup. This code loads a picture zoom function. See complete markup below. All that happens when the first zoom ...

Arrange dynamic content horizontally

Hello, I have a page where dynamic content arranges vertically one below the other. Content is small boxes & I want to arrange them horizontally next to each other. How can I achieve this ? Thanks. ...

Looking for an extended version of Lightbox

Hi All, I am not sure how to put this, maybe I'm not able to search it properly I'm not sure what is it called but I am looking for a script which is a kind of an extended version of lightbox script. I want to place some images in my website which when clicked opens as lightbox and can go next and previous but the trick is the next imag...

jQuery.ajax checking if there is already another xhr

I have a page when, if the user is near the bottom of the page, loads the next page. I just recently switched it to jQuery, and now use the jQuery.ajax() function to get the data. However, now i cannot check if the xhr is already loading, making the page load multiple xhrs when the user near the bottom. My listener is: $(document).scr...

CSS JQuery Tools Slider Z-Index Layering Issue

I have a complex layering situation for the website: http://andstones.ca/contact/ where I use a large background image for the content to scroll in and out of... Only problem is the transparent image covers up the content and makes links unclickable? Any idea for a fix that keeps the slider looking the way it does now? Thanks, Kor...

Capturing Print Events via Jquery/JS/Browser Specific APIs

Hi everyone, I wanted to ask if there is a way to capture the print events (like IE onbeforeprint and onafterprint events). Actually I would like to do more. I want to know if I could interrupt printing, cancel it or may be change the print option all together to have a myPrint option. Can this be achieved through plug-ins...

jQuery find img

<img src="http://site.com/some/category/thread_17.jpg" /> <img src="http://site.com/other/thread_17.jpg" /> How to find the last image on the page, that have "thread_" after last "/" in its src attribute? Script should throw src to some variable. Ajax is used to find the images on external page $.ajaxQueue({ url: link, type: 'GET...

JQuery:bind.blur() is not working

Hello, I need to add a row to a table.I am using jQuery to add the row.But i my Add() function everyhing is working fine except that the blur function for the input fild "txtQuantity" is not getting triggered for the newly added row.Here is my function, function Add() { var rowPart = $('#trPart0').clone(true).show().insertAfter('#tbl...

jquery - add to hidden input field on keypress?

I've got a hidden input field that I want to append text to depending upon what a user enters in two other fields. So, <input type="hidden" name="name" value="" /> <input type="text" name="first" value="" /> <input type="text" name="second" value="" /> If the user types First in the first input field and Second in the second input...

I want jQuery validator to add a class to the form element's parent

How do I use jQuery validator to add/remove a classname (e.g. validate) on the form element's parent <li> so I can style everything related to that element by only setting the one classname? The markup is <li class="validate"> <label for="product">Product of interest <abbr title="Required field">*</abbr></label> <input id="prod...

Twitter like status message using jquery...

I am using this jquery javascript function to show status message, function topBar(message) { $("<div />", { 'class': 'topbar', text: message }).hide().prependTo("body") .slideDown('fast').delay(4000).slideUp(function() { $(this).remove(); }); } and my css: .topbar { background: #476275; border-bottom: solid 2px #EE...

Creating a custom upload progress bar

Hi, I have seen all the upload progress bar plugins, widgets, etc. – they all suck. They're either too bulky with too much useless code or they don't work. What I want to know is where I can read up on how to display an easy upload progress indicator. Most browsers have a status progress bar on them below, but it isn't very professiona...

conditional or js to detect whether user is on windows XP?

Because windows xp renders certain fonts so poorly, i would like to detect whether the user is using that OS and add a class to the body accordingly. I'm looking ideally for an html conditional statement or php $_SERVER var to do this However failing that a piece of javscript along the lines of below would do if(users_os === 'xp'){ ...

Jquery AjaxForm returning False in OPERA in a https protocol

The error is shown only when i add a File input. I get a return of FALSE in the success event. happens only in Opera. Any idea where could be a problem ? http://jquery.malsup.com/form/ ...