jquery-animate

Jquery/Javascript Opacity animation with scroll

雨燕双飞 提交于 2019-11-27 12:31:29
I'm looking to change the opacity on an object (and have the transition be animated) based on a users scroll. example(http://davegamache.com/) I've searched everywhere like here, but it ends up pointing me to the waypoints plugin (http://stackoverflow.com/questions/6316757/opacity-based-on-scroll-position) I've implemented the [waypoints][1] plugin and have the object fading once it's higher than 100px. [Using the offet attribute] but would like to basically control the opacity of an object and have the animation be visible like the above example. I've searched all over- this is my last resort

How to animate CSS Translate

删除回忆录丶 提交于 2019-11-27 12:11:10
问题 Is it possible to animate the CSS property translate via jquery? $('.myButtons').animate({"transform":"translate(50px,100px)"}) and does it work in many browsers? Demo not working: http://jsfiddle.net/ignaciocorreia/xWCVf/ UPDATE: My solutions: Simple implementations - http://jsfiddle.net/ignaciocorreia/R3EaJ/ Complex implementation and multi-browser - http://ricostacruz.com/jquery.transit/ 回答1: $('div').css({"-webkit-transform":"translate(100px,100px)"});​ http://jsfiddle.net/xWCVf/5/ 回答2:

jQuery 1.6: backgroundPosition vs backgroundPositionX and FF4 compatibility

允我心安 提交于 2019-11-27 09:39:05
In an attempt to upgrade the jQuery plugin 'iCheckbox' (http://stackoverflow.com/questions/6032538/) to work above jQuery 1.4.4 I found out that the use of animate({backgroundPosition:'10px 0px'}) needed to be changed to animate({backgroundPositionX: '10px', backgroundPositionY: '0px'}) as only properties with one parameter should be used. So far, this makes sense, but wait.. while it's working fine in Safari and Chrome, it's not working in FF4 (all on Mac).. So i tried this and that and finally found out that if I change it to animate({backgroundPosition: '10px'}) It works everywhere! But

jQuery on window scroll animate background image position

给你一囗甜甜゛ 提交于 2019-11-27 09:37:50
问题 I am trying to achieve a scrolling effect using jQuery. I have a background div set to 100% browser window size with overflow hidden. This has a large background image that is approx. 1500px x 2000px. The effect I want is when the user scrolls down the page the background image moves at a percentage of the scrolled distance, so for every 200px scrolled down the page the image moves 10px in the same direction. Can anyone point me in the right direction? Is this even possible? : ) Many thanks

jQuery toggle animation doesn't work on new jQuery

匆匆过客 提交于 2019-11-27 08:26:51
问题 I have problem with this toggle on jQuery 1.8.2 i works but on 1.11.0 no. Can you help me what is wrong? $('.open').toggle(function () { $('.obj').animate({ top: "0" }, 500); },function () { $('.obj').animate({ top: "-8%", }, 500); }); 回答1: As mentioned in the comments you will need to do this using the click method. Here is an example that uses the element's data to store the state: $('.open').on('click', function(){ var isToggled = $(this).data('isToggled'); if(isToggled){ $('.obj').animate

Special color transition effect with pure jQuery animation // no ui or other libary

a 夏天 提交于 2019-11-27 07:17:13
问题 I am trying to create jQuery color animation without any external plugins. So far i could manage to do this with jQuery-ui but i want to learn this way with pure jQuery animate() Is is possible to do this with less code and without any external jQuery plugins on 1.8 ? Here is jsFiddle sample with jQuery 1.7.2 and ui jQuery: var Text = $('h1'); var Box = $('.box'); Text.click(function() { Text.animate({'color':'#f00'},600) .delay(200).animate({'color':'#ff0'},600) .delay(200).animate({'color':

How do you fadeIn and animate at the same time?

淺唱寂寞╮ 提交于 2019-11-27 06:52:27
Using jQuery I'm creating a basic 'tooltip' animation so that the tooltip will appear in a little animation in which it fades into view as well as move vertically. So far I have this: $('.tooltip').fadeIn('slow'); $('.tooltip').animate({ top: "-10px" }, 'slow'); Doing it that way or this way: $('.tooltip').fadeIn('slow').animate({ top: "-10px" }, 'slow'); The animations will run one at a time, the fade in first and then the vertical animation. Is there a way to have it do both at the same time? $('.tooltip').animate({ opacity: 1, top: "-10px" }, 'slow'); However, this doesn't appear to work on

Change Background Color CSS with Timer JQuery

断了今生、忘了曾经 提交于 2019-11-27 06:24:22
问题 I was hoping someone could show me efficient JQuery to animate between 4 background colors in a div class. I would like these events to be triggered by time, not click or hover. I've seen posts on hover and toggle, but as someone not very proficient in JQuery, I didn't feel comfortable copying and pasting parts here and there. Thank you 回答1: I dont know if you mean animated as in fading to the next, but heres a simple quick example of changing the color every 2 seconds. First example does not

How do you animate the value for a jQuery UI progressbar?

江枫思渺然 提交于 2019-11-27 06:23:28
I've setup a jQuery UI progressbar but can't use jQuery animate to animate it's value. Any ideas on how to make this work? The percentDone variable holds a number from 0 to 100 showing how far along the scrollbar should be (this works fine). I've tried several different things to no avail. Here's what I have so far: var progressbar = $("#progressbar1").widget(); progressbar.animate({ value: percentDone }, 5000, function() { console.debug('done animating'); }); Note that if I update the scrollbar using the "value" method it works fine but it jumps to that value instead of smoothly animating to

jquery animate a rotating div

落花浮王杯 提交于 2019-11-27 06:23:24
问题 I would like to rotate a div in an animate function such as $('div').animate({rotate: '30deg'},1000); I have found this: http://www.zachstronaut.com/posts/2009/08/07/jquery-animate-css-rotate-scale.html But I want to know if there is a more official way to do it or at least a different way. Thanks 回答1: If you're open to using CSS3 in combination with jQuery, perhaps this method may be of some use to you: HTML <div id="click-me">Rotate</div> <div id="rotate-box"></div> CSS #rotate-box{ width