JQuery :: Starting Second Animation Stops First One?
Jan 30, 2010
I have some links on my page with ajax calls, and the callback animates the links. My problem is, if I quickly click on two of them, the first one will begin to animate (ajax will complete successfully), and then when I click on the second one, the first one will stop animating, and only the second one will finish.
// document.ready
/* behavior for add to cart button */
$('a.item-addCart').live('click', function() { addToCart($(this)); } );
function addToCart(button){
/* parse data from button clicked, corresponding quantity box, and hidden price field */
$item_id = button.attr('id').split('-')[2];
$item_qty = $('input#item-addCartQuantity-'+$item_id).val();
$item_price = $('input#item-addCartPrice-'+$item_id).val();
/* set loading notification */
$('div#item-addCartActions-'+$item_id).html('<img src="/images/ajax-loader.gif" />');
/* AJAX */
$('div#item-addCartActions-'+$item_id).load(
'shopping_cart/add',
{item_id: $item_id, item_qty: $item_qty, item_price: $item_price},
function(responseText){
/* show response text */
$('div#item-addCartActions-'+$item_id).html(responseText);
/* pause on response text for 2 seconds */
$('div#item-addCartActions-'+$item_id).animate({opacity: 1.0}, 2000, function(){
/* fade out response text */
$('div#item-addCartActions-'+$item_id).animate({opacity: 0}, 'slow', function(){
/* show link to shopping cart */
$('div#item-addCartActions-'+$item_id).html('<a href="shopping_cart">Item in cart</a>').css('opacity', 1);
})});});}
View 2 Replies
ADVERTISEMENT
Sep 1, 2010
How can I make the script below "stop responding" when it's already animating?I want the script below to animate ONCE and STOP animating (even if mouse is still on element #s2) until I take mouse off it and hover again. This is what I'm using:
http:[url]....
<script type="text/javascript">$('#s2').cycle({
fx: 'scrollDown',
timeout: 0,[code].....
View 2 Replies
View Related
Nov 23, 2011
Is there any way to tell the cycle-plugin to wait with the next slide when the previous one is still animating?When i use the default animation with a next and prev button and I click quickly on the next button the slides start flicker.
I've searched the whole internet, but couldn't find anything regarding this.
This is the code I use:
$('#div_slider_big .div_fotos').cycle({
next: '#div_slider_big .div_navi_next',
prev: '#div_slider_big .div_navi_back',
speed: 1500,
timeout: 3000
});
View 2 Replies
View Related
Apr 29, 2009
I have the following code
$('input.productSubmitInput').click(function() {
$('#login-info')
.animate( { backgroundColor:"#7AFB73" }, 500 )
[code]....
View 1 Replies
View Related
Aug 30, 2011
I'm starting with jQuery and all I want is like jCarousel, but I want that when mouse is over image, the entire carousel freezes (until mouse over). So, my first idea is to create something like this:
<div class="photo" style="width: 256px; background-color: #8d99a2;" align="center">
<img class="photo_img" id="photo1" src="fotos/lookbook1.jpg"></div>
<div class="photo" style="width: 256px; background-color: #8d99a2;" align="center">
<img class="photo_img" id="photo2" src="fotos/lookbook/2.jpg"></div>
<div class="photo" style="width: 256px; background-color: #8d99a2;" align="center">
<img class="photo_img" id="photo3" src="fotos/lookbook/3.jpg"></div>
And Then, jQuery like this:
$(".photo").animate({
"right": "+=9999999999"
},{
duration: 200000000000,
easing: 'linear'
});
$(document).ready(function (){
$('.photo_img').mouseover(function(){
$('.photo').stop();
});});
The logic is that:
-> a list of images that go to right eternally, (like jCarousel in infinite mode), but when mouse is over, everything stops. (JCarousel waits until the "next()" function is complete), and when mouse is out, everything moves starting from the point that paused.
View 1 Replies
View Related
Jan 10, 2012
I have a button which is animated with a rollover effect, obtained through jQuery of course. I wish to open a lightbox clicking that button and I tried with a simple, self-made lightbox and with FancyBox but in either case the lightbox is displayed without animation.I post the code for my buttons and the lightboxHTML for buttons:
<ul> <li><div id="fader0"> <div class="from"><a class="products" href="#inline"><img src="images/tabproducts.png" alt="Our products" /></a></div> <div class="to"><a class="products" href="#inline"><img src="images/tabproductsHover.png" alt="Our products"
[code]....
View 1 Replies
View Related
Mar 20, 2011
How to re-start an animation after it's been stopped ?
function breathe() {
{ breatheIn();setTimeout('breatheOut()',6400); }
setTimeout( function() { breathe() }, 19200);
}
components:
function breatheIn() {
[Code]...
View 2 Replies
View Related
Feb 28, 2011
How do I search for all the <a> starting with with hrefhome?Example I could have 3 or 4 <a> that starting with the id of [code]
View 2 Replies
View Related
Oct 17, 2011
$('#nav li a').click(function(e) {
e.preventDefault();
$('#nav li a').removeClass('on');
[code]....
I need to do this, in addition to .click-binding, automatically; i.e., if no user-action by 15 secs I need this content-switching to start happening automatically; and also give 5 secs or so for the next div to show up (and hide div currently visible); how do I do this? like a slideshow, in other words, but switching divs (and doing the classes for the thumbnails)
View 2 Replies
View Related
Sep 2, 2011
Have cycle plugin implemented and it is functioning correctly except for the page quickly flashes the third slide before the rotation starts up.
I was able to assign opacity: 0 in the CSS for webkit and Firefox browsers that hides all three <LI>'s before it starts and that works. However, IE (even with filter: alpha(opacity=0);) won't take.
I tried using the cssBefore option but it throws an error when I try to put thefilter: alpha(opacity=0), into it.
Heres' the current code:
jQuery('.video-gallery').each(function() {
var holder = jQuery(this),
list = jQuery('.video-holder > ul', this),
switcher = jQuery('.items > ul', this),
[Code].....
View 2 Replies
View Related
Jul 18, 2010
How is it possible to get the class starting by 'date' of a specific element?
e.g. <p class="hello date123 world"></p>
I would like to get the class date123
View 5 Replies
View Related
Dec 4, 2010
How can I find all elements that have a attribute starting with some character?
Everywhere I found example like: $("[href$='.jpg']") which checks for all tags having an attribute "href" with value ending with "jpg" But how can I instead find all tags having a attribute having name ending with 'f'
something like $(img[$f]) ... trying to find all img with attribute ending with g
View 1 Replies
View Related
Jul 8, 2010
How to loop alternate elements in JQuery ? I see it has each function which loops each elements . But I want every alternate elments to loop starting from an index.is it possible in JQuery ?
View 1 Replies
View Related
Oct 25, 2010
Is there a quick jQuery one liner to return (as an array) all class names that start with "{insert_string_here}"The equivalent of the following:
Code:
var response = $( "*[class^='arete']");
var myClassArray = [];
for( var ix=0; ix < response.length; ix++)
[code]....
View 4 Replies
View Related
Nov 3, 2010
I'm using the uploadify jQuery plugin from here: [url] & am having some problems.
Everything is working correctly but the uploadifyUpload() function doesn't appear to be triggering. It is not accessing the add_list.php script whatsoever.
Here is my code from my header..
Code:
It correctly shows an alert box with "Correct" so I know it's getting in there to run it, but it just isn't running.
Shouldn't need to see this, but here is the errorCheck() function if interested..
Code:
Lastly this is the HTML code that calls it.. stripped out a lot of uneeded code for clarity.
Code:
View 11 Replies
View Related
Aug 27, 2011
I've been messing with this code to make a fade in animation with setTimout. The only thing is addition isn't working on the fade in. A subtraction on a negative works though. This seems strange to me.
changeit.style.opacity -= -0.01; works but when it's changed to changeit.style.opacity += 0.01; there's no fade in. It's the only thing I change. My intuition says to me it should work with addition, but maybe there's something I'm not understanding.
<html>
changeit.style.opacity -= -0.01; if this is set to changeit.style.opacity += 0.01; it doesn't work. What?
Of course this is all just for Firefox for now. If I put this in something useful I'll change it so it'll work in other browsers later.
View 8 Replies
View Related
Apr 14, 2010
I have a table with a SAVE button on each row (id=SaveBD)...but I also have aSAVE ALL button at the top. It works pretty good except the .each function seems torandomly stop near the end ofthe row countand not save all the rows.that would cause the rows to stop saving?
$(document).ready(function(){
$("#SaveAll").click( function(event){
$ ("#SaveAll").hide();
[code]....
View 1 Replies
View Related
Feb 9, 2010
Ok so this is weird. I implimented jquery to try and get some ajax funtionality working and it not olnly doesn't work, it stops the rest of my normal js from running at all.
[Code]...
EVERYTHING stops working. All my DOM events don't fire and none of my regular JS works. Anyone know how to get jquery code to work with or without normal JS code?
View 2 Replies
View Related
May 7, 2004
I have a gif animation that I want to stop when the user mouses over the gif, and restart when the user mouses out. Is there a way to stop and start gif animation with JS? Or will I have to use Flash instead?
View 3 Replies
View Related
Sep 1, 2010
WhenIrun the below code above the init code for jQuery plugins it stops them working. Im just trying to run the code after the DOM has loaded, is there a better way? <script type="text/javascript">$(document).ready(function() {
// The gallery is hidden so need to unhide it.
document.getElementById('verticalCarousel').style.visibility='visible'
})
</script>
View 4 Replies
View Related
Jul 15, 2010
photo1.gif fades in as expected, then fades to photo2.gif, but then nothing else happens.
$(function() {
$('#slideshow img:first').fadeIn(1000, function() {
$('#slideshow').cycle();
});
[Code].....
View 1 Replies
View Related
Apr 22, 2009
We have a page that allows a user to load a form over ajax using jQuery 1.3.2. The form contains a simple table layout, some input boxes, tinymce and the initialize for a jQueryUI dialog. On first load everything works fine. If the user loads the same form again, without refreshing the browser window, TinyMCE no longer shows content, can’t be clicked inside of and the dialog no longer updates it’s content and a few other bits of js stop firing.
Now I thought this was an issue with the page and ajax, but we have another page that uses draggable elements and has a very simple form of 1 input and a submit. If you submit the form and get returned the same page by our validation the same thing happens as with tinymce, you can no longer click inside it.
In ie7 things dont stop responding so much but the browser slows down and almost stops responding.
View 2 Replies
View Related
Oct 13, 2011
I've implemented the jqueryPreloader I found here. It work fine except for two pages in wich the script stops without end and so the page is not visible...the web site where I added the scriptinfo and contact page where the script doesn't workI looked to the firebug console but there isn't any apparent error... but the script loads the screen-wide div (.QOverlay) with #fff background and ends without load the loading bar and without fading out the .QOverlay div
View 14 Replies
View Related
Jan 8, 2012
I'm trying to use the cascade function from the below link. If I try it as it is there, it works, but if I change the jquery reference to the one I'm using (1.7.1) it stops working... is there a diferent way to use that ajax call or am I missing anything?
View 3 Replies
View Related
May 28, 2011
I am using the jquery sliding panel, and have embeded a music player. Everytime I minimize the sliding panel, the music player stops. Here is a link to my example, if you click on radio on the left: Vertical Sliding Info Panel With jQuery
View 1 Replies
View Related
Oct 15, 2002
I have a frame called 'HEADER'. From this frame I would like to innitiate a Javascript Function in a frame called 'CONTENT'. ( function SearchWindow() {....} )
Is this possible and what should the script look like?
parent.content... is as far as I got. But I can't find the right function/variable for calling a function.
The root of the problem is a searchwindow is opened from Header. And in the searchwindow people can click on links... afterwhich the content-frame should change (with an PageID). But I can only get the HEADER frame to respond.
View 1 Replies
View Related