jquery-animate

Passing variables to JQuery animate

我怕爱的太早我们不能终老 提交于 2019-12-10 19:06:25
问题 $(document).ready(function(){ for(var i=1;i<5;i++){ var pos = -411*i; var pospx = "{'background-position-x':'"+ pos.toString() + "px'}"; $("#newsPix").delay(2000).animate(pospx, 1000); } }); I'm a jquery beginner, and I'm trying to use animated sprites to make something similar to a slideshow. I've been trying to make this code work for hours but I'm not sure where the probelm is! I've checked the HTML and CSS and they seem fine. I think the problem lies in either passing a value to the

Animate jQuery height percentage

时光怂恿深爱的人放手 提交于 2019-12-10 18:35:28
问题 When I'm trying to animate percentage, it's not animating, but expanding to whole height instantly. I want it to expand to 100%, but smoothly CSS: #block-views{ overflow:hidden; height:20px; } HTML: <div id="block-views"> 1<br/> 2<br/> 3<br/> 4<br/> 5<br/> 6<br/> 7<br/> 8<br/> 9<br/> 10<br/> </div> <a href="#" class="loadmore">Load more</a> Jquery code: $(function() { $( ".loadmore" ).toggle( function() { $( "#block-views" ).animate({ height: "20px", }, 1000 ); }, function() { $( "#block

Turn off animation Jquery Accordion

孤街醉人 提交于 2019-12-10 18:26:10
问题 How can i turn off the animation effect on this accordion? so that when I click the sections it just opens instantly, rather than slow drop down? www.immateriallabour.com/EBH-Pub <script> $(function() { $( "#accordion" ).accordion({ collapsible: true }); ({ animate: false }); }); </script> 回答1: If you want to prevent the accordion animation, you should pass the appropriate property as part of the configuration object, as follows: $(function () { $("#accordion").accordion({ collapsible: true,

Don't queue fadeTo(), fadeIn()/fadeOut()

筅森魡賤 提交于 2019-12-10 18:15:28
问题 I have the following animations: $('#id').animate({'margin-top': 100, 'margin-left': 100}, {queue: false, duration: 1000}); $('#id2').fadeTo(1000, 1); this seems to be queuing, how can i make sure that fadeTo() doesn't queue? 回答1: Try: $('#id2').stop().fadeTo(1000, 1); 回答2: Move the opacity change into the animation. $('#id').css({opacity:0}).show().animate({marginTop: 100, marginLeft: 100, opacity:1}, 1000); http://jsfiddle.net/vcBPR/ 来源: https://stackoverflow.com/questions/6640929/dont

jQuery animate not working on safari

大城市里の小女人 提交于 2019-12-10 18:10:49
问题 I have this jQuery code which animates a div. It works perfectly on Firefox and Chrome, but in safari it doesn't move, it is just rotating, and in internet explorer it moves without rotating! any idea on solving this is appreciated. jQuery: $(document).ready(function() { $(".plane").animate({ 'top':'-=0px', 'left':'+=0px', rotate:-50 }, 500, 'swing'); $(".plane").animate({ 'top':'-=35px', 'left':'+=590px', rotate:-60 }, 7000, 'easeOutQuart'); $(".plane").animate({ 'top':'-=0px', 'left':'+=0px

How to fix IE ClearType + jQuery opacity problem in this script?

﹥>﹥吖頭↗ 提交于 2019-12-10 17:47:54
问题 I'm having a rather common problem (or so it seems, after some googling around...) with IE messing both bold text AND transparent pngs while animating opacity using jQuery. You can view the sample here: http://dev.gentlecode.net/dotme/index-sample.html (only occurs in IE, obviously) I've seen some blog posts saying the fix is to remove the filter attribute but I'm not sure how to apply it to the script I'm using since I got it from a tutorial and am still learning jQuery... The script goes as

Simultaneous jQuery Animations

喜欢而已 提交于 2019-12-10 17:13:57
问题 I'm trying to get both a fadeIn (opacity toggle) and border fade (using jquery-animate-colors) to fire simultaneously but I'm having some trouble. Can someone help review the following code? $.fn.extend({ key_fadeIn: function() { return $(this).animate({ opacity: "1" }, 600); }, key_fadeOut: function() { return $(this).animate({ opacity: "0.4" }, 600); } }); fadeUnselected = function(row) { $("#bar > div").filter(function() { return $(this).id !== row; }).key_fadeOut(); return $(row).key

jQuery for animating border radius

◇◆丶佛笑我妖孽 提交于 2019-12-10 16:25:39
问题 I have a problem animating border-top-left-radius style. I use this style by entering two length values separately. border-top-left-radius: 15px 25px; I would like to increase these two length values separately via jquery.animate() . Is there a way to achieve this? 回答1: border-top-left-radius accepts just one value right? So you would animate it like: $('.class').animate({borderTopLeftRadius: 20}) EDIT Not sure if jQuery supporst this out of the box. Maybe you can implement the step callback

JQuery Replace Element w/ Slide Left Effect

我是研究僧i 提交于 2019-12-10 15:31:42
问题 Currently im using fadeOut animation effect in replace content of a div element. $('#divID').fadeOut('slow', function(){ $(this).replaceWith( $div ); }); How can I achieve slide to left effect when replace content of the div element? 回答1: Don't know if there is a specific effect for that, I used $().animate({left: val}) to achieve that. var width = $(window).width(); $('#divID').animate({left : -width}, 500, function(){ $div.hide() }); $div.css({left: width}).show().animate({left: 0}, 500);

Jquery animate bottom problem

笑着哭i 提交于 2019-12-10 14:56:03
问题 It's strange. I have an animation that start when i .hover on a DIV. Into this div i have another in position absolute that i want to move up until the mouse stay on main div and go down in your position when i go out of main div. A simple hover effect. I have write down this function that work well apart a strange bug. var inside = $('.inside') inside.hover(function() { $(this).children(".coll_base").stop().animate({ bottom:'+=30px' },"slow") }, function() { $(this).children(".coll_base")