Search Results

Search found 1022 results on 41 pages for 'animate'.

Page 4/41 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Using jQuery's animate(), if the clicked on element is "<a href="#" ...> </a>", the fucntion should

    - by Jian Lin
    I was reading jQuery's page for animate() http://api.jquery.com/animate/ Its examples don't mention about if using <a href="#" id="clickme">click me</a> ... $('#clickme').click(function() { $('#someDiv').animate({left: "+=60"}); }) we actually still have to return false like in the old days? $('#clickme').click(function() { $('#someDiv').animate({left: "+=60"}); return false; }) (but then, those examples didn't use a <a> for the "click me"... but used something else. Otherwise the page will jump back to the beginning of the page? Does jQuery have a more elegant or magical way of doing it?

    Read the article

  • jQuery animate element reveal - bottom to top

    - by Jon Hadley
    I'm trying to animate a horizontal lists appearance. It's a top navigation bar. The following works pretty well, but it animates in from the top (of, I assume, the ul) to the bottom. How would animate bottom, up? $("#topnavigation li").css({height:'0'}); // 'hide' it first $("#topnavigation li", this).stop().animate({height:'23px'},{queue:false,duration:1000});

    Read the article

  • using jQuery .animate to animate a div from right to left?

    - by Alex
    Hi, I have a div absolutely positioned at top: 0px and right: 0px, and I would like to use jquery's .animate() to animate it from it's current position to left: 0px. How does one do this? I can't seem to get this to work: $("#coolDiv").animate({"left":"0px"}, "slow"); Why doesn't this work and how does one accomplish what I am looking to do? Thanks!!

    Read the article

  • Having trouble using jQuery's .animate() to animate a div from left to right, right to left?

    - by Alex
    Hello, I seem to be having difficulties using jQuery .animate() to animate an absolutely positioned div from right to left on a button click, and left to right on another button click. I was wondering if you would be willing to help me understand what I'm doing wrong? Thanks. Below is my relevant CSS, HTML, and jQuery code. I can click the #moveLeft button and it wil indeed animate it to the left, but when I click the #moveRight button, nothing happens. Where am I going wrong? Thanks!! CSS #scorecardTwo { position:absolute; padding:5px; width: 300px; background-color:#E1E1E1; right:0px; top:0px; display:none; } HTML text text Left Right jQuery $("#scorecardTwo").fadeIn("slow"); $("#moveLeft").bind("click", function() { var config = { "left" : function() { return $(this).offset().left; }, "right" : function() { return $("body").innerWidth() - $K("#scorecardTwo").width(); } }; $("#scorecardTwo").css(config).animate({"left": "0px"}, "slow"); $(this).attr("disabled", "disabled"); $("#moveRight").attr("disabled", ""); }); $("#moveRight").bind("click", function() { var config = { "left" : function() { return $(this).offset().left; }, "right" : function() { return $("body").innerWidth() - $K("#scorecardTwo").width(); } }; $("#scorecardTwo").css(config).animate({"right" : "0px"}, "slow"); $(this).attr("disabled", "disabled"); $("#moveLeft").attr("disabled", ""); });

    Read the article

  • jQuery animate opacity doesn't work properly on IE

    - by fidoboy
    I'm trying to use animate function to change the height and opacity for a DIV. The div has a image background in CSS, it works fine on Firefox and Safari, but when i test it on IE the background is being removed. This is my code: if (jQuery.support.opacity) { jQuery('#list_box').animate({opacity: '1',height: '300px',top: newTop},{duration: 300}); } else { jQuery('#list_box').animate({filter: 'alpha(opacity=100)',height: '300px',top: newTop},{duration: 300}); } How can i fix it?

    Read the article

  • Animation using AniMate with Unity3D doesn't interact with physical objects

    - by Albz
    I'm designing a maze with Unity3D. The maze has a number of bifurcations and the player will stop before each bifurcation and simply choose left or right. Then an automatic animation will move the player through the next bifurcation till the end of the maze (or till a dead end). To animate the player I'm using AniMate and C# in my Unity project. Using AniMate I'm simply creating a point-to-point animation for each bifurcation (e.g. mage below: from the start/red arrow to point 5) My problem is that my animation script (associated to the "First Person Controller") is not working properly since physics is not respected (the player passes through walls). If in the same project I enable the standard character controls in Unity, then I can navigate in the maze with the physical contrains of walls etc... (i.e. I have colliders). This is an example of the code I'm using when I press left to pass from starting point, trough point 1 to point 2: void FixedUpdate () { if (Input.GetKey(KeyCode.LeftArrow)) { //To point 1 Hashtable props = new Hashtable(); props.Add("position", new Vector3(756f,112f,1124f)); props.Add("physics", true); Ani.Mate.To(transform, 2, props); //To point 2 Hashtable props2 = new Hashtable(); props2.Add("position", new Vector3(731f,112f,1124f)); props2.Add("physics", true); Ani.Mate.To(transform, 2, props2); } } What happens practically when I press the left arrow button is that the player moves directly to point 2 using a straight line passing through the wall. I tried to pass to AniMate "Physics = true" but it doesn't seem to help. Any idea on how to solve this issue? Alternatively... any hint on how to have a more optimized code and just use a series of vector3 coordinates (one for each point) to obtain the simple animation I want without having to declare new Hashtable(); etc... every time? I chose AniMate simply because 1. I'm a beginner with Unity 2. I don't need complex animations (e.g. I don't need to use iTween), just fixed animations along straight lines and I need something really simple and quick to implement in a script. However, if someone has an equally simple solution it will be welcome. thank you in advance for your help

    Read the article

  • Margin animate problem with Monitor display settings

    - by Jake
    I have an issue with an animation on a webpage. I have this div with text inside of it that I set the margin using css and when the page is loaded I use jquery to animate the div to a certain part of the page. The problem is it works with my concrete pixel settings, but if I change the properties of the monitor display settings in screen resolution(pixels), the div does not animate to the appropriate spot and it doesn't even start off at the appropriate spot from the css. Sample code: #div{ position:absolute; top:20px; left:50px } $("#div").animate({marginLeft: "250px"},2000); Is there a way to have the settings of the animation margin end at the approriate position no matter what the screen resolution is?

    Read the article

  • Animate jquery ui slider handle to specific value

    - by user1159555
    I'm trying to animate a jquery UI handle to a specifiv value. My code is this so far. $("#slider1").slider({ max:350, min:100, animate: 'slow', step:10, animate: "true", value: 0, change: function() { // This setTimeout will allow the slider to animated correctly. setTimeout("$('#slider1').slider('value', 200);", 350); } slide: function(event, ui) { $("#amount").val(ui.value); $(this).find('.ui-slider-handle').html('<div class="sliderControl-label v-labelCurrent">'+ui.value+'</div>'); update(); } }); $('#slider').slider('value', 200); How do I make it so that 1) The handle will go to the specific value on page load and 2) The handle can be freely moved after the page has loaded and the animation has finished. Cheers, Jonah

    Read the article

  • WPF Animate a Matrix using interpolation

    - by Mark
    I'm having a issue with my application that is using touch gestures to scale, translate and rotate my scene. I was using a TransformGroup which contained TranslateTransform, ScaleTransform and a RotateTransform but I could not get the movement correct, it always jumps and skips, so I moved to a MaxtrixTransform which I was able to use much easier to get my scene to be zoomable, rotatable and panable nicely. However, what I later found out was that you cannot animate smoothly (using interpolation) the values of a Matrix, for what reason I have no idea, but its part of the MSDN doco and the properties of the Matrix are not dependency properties anyways... Has anyone had any luck animating a matrix to make it smooth? The only idea(s) I have had is to animate a few different, custom DP which all have callbacks that I update the matrix from OR To convert the matrix to a set of Transform objects that I then animate and then afterwords convert back. Is there a smarter way to do this?

    Read the article

  • WPF Animate a Maxtrix using interpolation

    - by Mark
    Im having a issue with my application that is using touch gestures to scale, translate and rotate my scene. I was using a TransformGroup which contained TranslateTransform, ScaleTransform and a RotateTransform but I could not get the movement correct, it always jumps and skips, so I moved to a MaxtrixTransform which I was able to use much easier to get my scene to be zoomable, rotatable and panable nicely. However, what I later found out was that you cannot animate smoothly (using interpolation) the values of a Matrix, for what reason I have no idea, but its part of the MSDN doco and the properties of the Matrix are not dependency properties anyways... Has anyone had any luck animating a maxtrix to make it smooth? The only idea(s) I have had is to animate a few different, custom DP which all have callbacks that I update the Matrix from OR To convert the Maxtix to a set of Transform object that I then animate and then afterwords convert back. Is there a smarter way to do this?

    Read the article

  • Couldn't assign 'top' from variable in jQuery Animate

    - by bhu1st
    Hi, I am stuck here, i am trying to animate number of 'x' divs (the code below is just for one div) by selecting their original 'top' position & adding some 'newTop' pixel values to them. var dur = 1500; var origTop = $("#div_x").position().top; var newTop = parseInt(origTop) + 30; $("#div_x").animate({ top : newTop + "px" }, dur); I checked alerting the 'newTop' variable and it's showing correct values but the animation is not working. I tried different variants to assign 'top' to the animate function but nothing is working. any suggestion would help me a lot. thanks in advance.

    Read the article

  • Animate tray icon while processing

    - by sjlewis
    How can I animate the tray icon while the main application is processing? I already tried the suggestion here, but the icon does not animate during process. I also tried putting the animation in a separate thread but still no luck.

    Read the article

  • How to animate line-drawing in iPhone development?

    - by david
    I have been searching around, but there seems no good answer for this simple question. So I am asking again: how to animate line-drawing in iphone dev? Basically what I want is something like this: @implementation MyUIView - (void) triggerLineDrawing: (CGPathRef) path { ... // animate line drawing here } Can it be done?

    Read the article

  • jquery animate - dead simple

    - by danit
    All I want to do is on .click() is .animate #slip, essentially Im changing the css at the moment from top: 10px to top: 0px Instead of it being quite clunky i'd like to animate the movement on the change of CSS. Currently use .toggleClass to achieve this: $("#div1").click(function() { $("#div2t").toggleClass('min'); });

    Read the article

  • jQuery animate Toggle

    - by danit
    Here is my code so far: $(document).ready(function(){ $("#slider").click(function() { $("#insight").animate({ top: "25px",}, 300, function() { $("#insight").animate({ top: "89px",}, 300); }); }); }); I want this to act like .toggle(), where by on click #div1 slides up to top:25px and then stops, but when clicked again slides down to top:89px. Can anyone expand the function above to achieve this?

    Read the article

  • JQuery not Working in chrome?

    - by Pete Herbert Penito
    Hi everyone! I have some code here which works perfectly in firefox but not in chrome or IE, my javascript is thus ` $(document).ready(function() { $("#clientLoginPop").show(); $("#clientLoginPop").animate({"left": "-=400px"}, "fast"); }); $("#clientLoginCloseLink").click(function () { $("#clientLoginPop").animate({"left": "+=400px"}, "fast"); }); $("#contactUsPopLink").click(function () { $("#contactUsPop").show(); $("#contactUsPop").animate({"left": "-=437px"}, "fast"); }); $("#contactUsClose").click(function () { $("#contactUsPop").animate({"left": "+=474px"}, "fast"); }); }); ` and finally the css of the div looks like this, i think rather importantly it's aligned to the right of the browser: (the client login div looks similar just a different height) ` #contactUsPop { width:437px; right:-437px; margin-top:220px; position:fixed; height:217px; background-color:white; z-index:2; } ` so what happens in firefox is the div animates to the left and then when it closes it moves back to the right. when in chrome the div doesn't seem to pop up at all? the URL of the site is this: http://clearcreativegroup.com/devcorner/clear3/ the tabs are on the right hand side of the browser, any advice would help tons, thank you!

    Read the article

  • CATransaction: Layer Changes But Does Not Animate

    - by macinjosh
    I'm trying to animate part of UI in an iPad app when the user taps a button. I have this code in my action method. It works in the sense that the UI changes how I expect but it does not animate the changes. It simply immediately changes. I must be missing something: - (IBAction)someAction:(id)sender { UIViewController *aViewController = <# Get an existing UIViewController #>; UIView *viewToAnimate = aViewController.view; CALayer *layerToAnimate = viewToAnimate.layer; [CATransaction begin]; [CATransaction setAnimationDuration:1.0f]; CATransform3D rotateTransform = CATransform3DMakeRotation(0.3, 0, 0, 1); CATransform3D scaleTransform = CATransform3DMakeScale(0.10, 0.10, 0.10); CATransform3D positionTransform = CATransform3DMakeTranslation(24, 423, 0); CATransform3D combinedTransform = CATransform3DConcat(rotateTransform, scaleTransform); combinedTransform = CATransform3DConcat(combinedTransform, positionTransform); layerToAnimate.transform = combinedTransform; [CATransaction commit]; // rest of method... } I've tried simplifying the animation to just change the opacity (for example) and it still will not animate. The opacity just changes instantly. That leads me to believe something is not setup properly. Any clues would be helpful!

    Read the article

  • JQuery: Run animations on the element's contents

    - by BHare
    I have a div that has some padding, border, and style applied to it. Inside the div I have just some plain text. Something like this: <div id=test style="border: 2px solid black; background-color: blue;"> The text I would like to animate </div> Normally to animate the contents I would do something like this: $('#test > *').hide(1000); But apparently the > * only selects child elements, and not non-elements (text for example) So my current work around is: <div id=test style="border: 2px solid black; background-color: blue;"> <span>The text I would like to animate</span> </div> Making a span that is not really needed.

    Read the article

  • JQuery animation

    - by Ravindra Soni
    I am using following code for animation using jquery. When I click on a list element, the corresponding div slides down and opacity goes to '1'. When I click other list element, the previous one goes up and fades, and the next one come down. var id_prev; var id_new; $("#tag ul li ").click(function(event){ var i = $(this).index()+1; var id_new="#person"+i; if(id_new != id_prev){ $(id_prev).animate({top:'300px',opacity:'0'},500); $(id_prev).delay(200).css({'z-index':'0'}); $(id_new).delay(200).css({'z-index':'300'}); $(id_new).delay(200).animate({top:'300px',opacity:'0'},500); $(id_new).delay(200).animate({top:'330px',opacity:'1'},500); id_prev = id_new; } });

    Read the article

  • jQuery: How to smooth animated image resizing

    - by nikibrown
    I'm a jQuery noob - so please excuse the probable basicness of this question. I'm doing something pretty simple - on hover animate the position and size of an image. When you mouse over the images there are some noticeable 'jaggies' - is there a way to get rid of this? The jquery code is as follows and a live link is here kristechdev.metropoliscreative.com (hover over the icons). <script type="text/javascript"> $(document).ready(function() { $('#zoomNav li img').hoverIntent( function() { $(this).animate({'margin-top' :'-35px', 'margin-left' :'-10px', 'height' :'95px','width' : '79px' }, 'fast'); }, function() { $(this).animate({'margin-top' : '0px', 'margin-left' :'0px', 'height' :'70px','width' : '58px' }, 'fast'); }); }); </script>

    Read the article

  • jQuery simplifying code (beginner)

    - by Jonny Wood
    I'm getting to grips with jQuery but find myself repeating code over and over again... Surely there's a simpler way to write this: $('#more-mcr, #more-hilton, #more-lpool').hide(); $('#mcr-hatters').hoverIntent(function() { $('#mcr-hilton').stop().animate({opacity: 0.4}); $('#more-mcr').fadeIn({duration:200}); }, function() { $('#mcr-hilton').stop().animate({opacity: 1}); $('#more-mcr').fadeOut({duration:200}); }); $('#mcr-hilton').hoverIntent(function() { $('#mcr-hatters').stop().animate({opacity: 0.4}); $('#more-hilton').fadeIn({duration:200}); }, function() { $('#mcr-hatters').stop().animate({opacity: 1}); $('#more-hilton').fadeOut({duration:200}); }); $('#lpool-hostel').hoverIntent(function() { $('#more-lpool').fadeIn({duration:200}); }, function() { $('#more-lpool').fadeOut({duration:200}); }); $('#offers-mcr').hoverIntent(function() { $('#offers-lpool').stop().animate({opacity: 0.4}); $('#offers-bham').stop().animate({opacity: 0.4}); }, function() { $('#offers-lpool').stop().animate({opacity: 1}); $('#offers-bham').stop().animate({opacity: 1}); }); $('#offers-lpool').hoverIntent(function() { $('#offers-mcr').stop().animate({opacity: 0.4}); $('#offers-bham').stop().animate({opacity: 0.4}); }, function() { $('#offers-mcr').stop().animate({opacity: 1}); $('#offers-bham').stop().animate({opacity: 1}); }); $('#offers-bham').hoverIntent(function() { $('#offers-lpool').stop().animate({opacity: 0.4}); $('#offers-mcr').stop().animate({opacity: 0.4}); }, function() { $('#offers-lpool').stop().animate({opacity: 1}); $('#offers-mcr').stop().animate({opacity: 1}); }); I'd also like to set the delay for hoverIntent but I don't think this is possible with the way I've written the code currently...?

    Read the article

  • images are getting clipped when Jquery animate opacity is used in IE

    - by Raja
    I use the function given below: function rotate() { //Get the first image var current = ($('div#rotator ul li.show') ? $('div#rotator ul li.show') : $('div#rotator ul li:first')); //Get next image, when it reaches the end, rotate it back to the first image var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator ul li:first') : current.next()) : $('div#rotator ul li:first')); //Set the fade in effect for the next image, the show class has higher z-index next.css({ opacity: 0.0 }) .addClass('show') .animate({ opacity: 1.0 }, 1000); //Hide the current image current.animate({ opacity: 0.0 }, 1000) .removeClass('show'); }; It does a slide show of images. It works perfect on Firefox and Google Chrome but clips the images in IE 7 and IE 8. Any help is much appreciated. Thanks in advance.

    Read the article

  • jQuery animations are choppy and stutter in Firefox

    - by J.Milly
    I like think I'm not a dummy but I can't get my jQuery horizontal slideshow to animate smoothly especially in FireFox (on a Mac). Anyone have advice? Animation is being done like so: $('#lookbook').stop().animate({left: -((lookbook-1)*825)+'px'}, { duration: 800, complete: cap_fade(1)}); Example link: http://mayfourteenth.com/w/lookbook?preview=1

    Read the article

  • JQuery plugin to animate overlay

    - by Gary
    I'm looking for a JQuery plugin to animate the appearance and disappearance of an overlay div. Something like what Rackspace has here: http://www.rackspacecloud.com/ After staring at the page for 30 seconds or so, a div comes sliding down from the top asking you whether you want to chat with a rep. If you ignore the div for a period of time it slides back up. I know I could hand code all this using timers and animate() and such, but hoping someone has done it for us already. Any ideas?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >