jquery

JQuery Validation Plugin: remote method data issue

I'm using the jquery validation control remote method to test if an email address already exists in the database. Everything works fine the first time validation fires. However, on subsequent validations, the data being passed to the web service is the old data and not the new data entered into the textbox. e.g. An email address is ty...

Preloading wav/mp3 files in jQuery

I have this code (found from another StackOverflow question: $(document).ready(function() { $.ajax({ url: "soundfile.mp3", success: function() { $("#play_button").show(); } }); }); This code works fine, but how can I amend it to handle multiple sound files? ...

Select text and then calculate its distance from top with Javascript?

Is it possible with JavaScript to find a given string of text on a webpage, and then calculate its distance (in pixels) from the top of the page? If so, an example would be appreciated. ...

jQuery move and accelerate to a direction for unknown distance (smooth scroll)

Imagine this code (simplified) <img id="leftArrow"/> <div style="overflow:hidden; width:300px"> <img id="wideImage" style="width:1000px; position:absolute; left:0"/> </div> <img id="rightArrow"/> that will result in something like this How do you make #wideImage scroll smoothly to the left when #rightArrow is hovered? I am after ...

jquery how to re-detach a detach on option

Hello, I need help concerning following code: http://jsfiddle.net/8PsdE/ <SELECT ID="pizzasize" NAME="pizzasize"> <OPTION VALUE="s">small <OPTION VALUE="m">medium <OPTION VALUE="l">large </SELECT> $(function() { $('#pizzasize > option[value*="m"]').detach(); }); How can I add the detached option back again? Thx in advance... ...

Image of progress bar (Full) with fade in background

I want to show progress bar just lightbox image shows and it should display 100 % progress bar status when i'm posting data from one page to other. How can i do that? ...

Simple jQuery gallery which can load content dynamically

Hi, I need some jQuery plugin, tutorial or guidelines to create simple image gallery which content could be loaded dynamically, it would display one image at the time, and that image would be changed by sliding it to the left or right. I have tried jCarousel, but I could not manage to make it show only one image at the time with dynam...

jQuery own plugin help - refer to wrong element

I have written a plugin that looks like this so far: (function($) { var textarea; $.fn.bbcode = function(opt) { var i = 0; return this.each(function(i) { textarea = this; var strHTML = '<div id="editor" class="editor-instance-' + i + '">'; strHTML += '<div class="btn ...

How can I create many divs on on top of the other using CSS/jQuery?

Basically, I want many(>25) divs to be displayed one on top of the other so that only one can be seen at a time. I have the jQuery UI draggable implemented, so once a div is dragged away, the next div is shown. What CSS do I need to make such a stack of divs? jQuery is also available if required. Thanks! ...

Using two jquery plugins in one page doesn't seem to work...

I am using a jquery cycle plugin and flexdropdown in one page... What happens is either one of the plugin is working but not both.... <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; <script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/...

Use jQuery to select, then use YUI to animate? Good idea?

jQuery's animation engine isn't working well for me. It doesn't have easing and color animation built-in, and the plugins I am using for them don't work properly together consistently. I've had good experience with YUI's animation engine in the past. Is it possible to use jQuery to select items, and then use YUI to animate them? Here's ...

jquery .attr() problems

I wrote this quick tooltip function for my links: $(function() { $('a').hover(function(e) { var title = $(this).attr('title'); $('<div id="tooltip">' + title + '</div>').css({"top" : e.pageY + 12, "left" : e.pageX + 12}).appendTo('body'); }, function() { $('#tooltip').remove(); }); $('a').mousemove(function(e){ ...

How to retrieve a element by class name by its position

How do you translate the following into jQuery? document.getElementsByClassName('x')[5] $('.x')[5] does not seem to work. i could go with a $('.x').each(){function(i){ if(i==5) return $(this) }) but there must be an easier inline way. ...

Problem with two JavaScript codes

I have these two codes - new function($) { $.fn.getCursorPosition = function() { var pos = 0; var el = $(this).get(0); // IE Support if (document.selection) { el.focus(); var Sel = document.selection.createRange(); var SelLength = document.selection.createRange().text.length; Sel.moveStart('character', -el.value.length)...

image slide gallery with jquery

Hi guys I'm try to create a sliding banner with jquery here. I tried to code in this manner .post(this,{ajax : 1}, function(data){ var oldImage = $('div.banner > img'); var newImage = $(data).insertAfter(oldImage).css('position','absolute').css('left',800); newImage.load(function(){ oldImage.animate({left:-800},'med...

remove table without id using jquery

I have the following dynamically generated table on a page along with other tables on the page. I need to remove this table which does not have an id.There is one of two ways that I can think of to target the table for removal since these never change. By the class="matching_results_text" or by the text "You are here" Just do not know ...

$("html, body").animate({scrollTop:0}, 'slow'); is not working in my page.

i have already included jquery.js and jquery.1.3.2.js on my page for other functionality.I think it is getting conflicted with other.plz reply ...

Can't replace a div inside of an iframe from its parent

I've got an iframe that I filled like this: var usableUrl = unescape(url); var iframe = $("<iframe id='pageContentDownloader' name='pageContentDownloader' style='display:block'></iframe>"); $("body").append(iframe); iframe.load(usableUrl, null, ondocloaded); iframe.css({ "width": $(window).width(), "height": $(window).height(), "border"...

jQuery get an image source encrypted/

Hi guys, i kinda sorted out my problems with forms with using serializeArray, but as you may know it lacks of support for input/file, so decide to merge it with my serialized data. Now i create the object and everything i get the name of the file with .val(). But i can't the image source. For example i wanna do this: alert(jQuer...

Progressbar in lightbox

I have an animated progress bar and i want to show it on lightbox using onclick event in drupal. So that when i click on submit button it shows a progress bar inside the lightbox. Please tell me how can i do that? ...