fade

Fading multiple elements simultaneously - jquery

故事扮演 提交于 2019-12-05 19:37:02
问题 I want to do the following: $(newPanel, prevBtn, nextBtn, infoPanel).fadeIn(200, function() { } these vars are divs created with jquery but only the first element fades in, I really need all elements to fade in at the same time. 回答1: You can use the add method to get the elements in the same jQuery object: newPanel.add(prevBtn).add(nextBtn).add(infoPanel).fadeIn(200); 回答2: Assuming that newPanel and so on are variables created like that: newPanel = $("#newPanel"); just write: newPanel.fadeIn

Add alpha to shader in Unity3D

两盒软妹~` 提交于 2019-12-05 19:05:19
I don't have any idea about shader programming but right now I need to add alpha to the shader that I want to use. Actually I want to fade in and fade out my sprite but it's not in the shader that I use. Shader : Shader "Sprites/ClipArea2Sides" { Properties { _MainTex ("Base (RGB), Alpha (A)", 2D) = "white" {} _Length ("Length", Range(0.0, 1.0)) = 1.0 _Width ("Width", Range(0.0, 1.0)) = 1.0 } SubShader { LOD 200 Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" } Pass { Cull Off Lighting Off ZWrite Off Offset -1, -1 Fog { Mode Off } ColorMask RGB Blend

How to cross fade between AVAudioPlayers

走远了吗. 提交于 2019-12-05 18:05:38
I want to use AVAudioPlayer and cross fade more than 2 mp3 files. I have 5 mp3 files and 5 pages "myScrollView" with UIScrollView class and pagingEnabled = YES. When user move page, I want to play each songs for each page with volume fade out for previous mp3 file and fade in for next mp3. Please help this problem. This is not cross fading operation. But, this can fade-in/out one at a time with new thread using NSOperation and fade-in/out effects can be added to the thread in any order. I found Linear fade Object MXAudioPlayerFadeOperation created by Andrew Mackenzie-Ross on 30/11/10. mackross

Fading one div into another: Make more stable, remove white pause, multiple fades

谁说我不能喝 提交于 2019-12-05 14:23:19
I have a test setup where the thumbnail div fades into another div, there's a couple of problems with it though. How can I remove the white pause? At the moment it fades one div out to white then fades in the second div. How can I make it fade from one div to the other without it fading to white? It's a little unstable, if you hover over quickly and out the second div appears below the original. How can I make it a bit more stable? I'm going have multiple thumbnails with different images and text in each one, how can I setup the grid to include multiple boxes without them all fading in/out at

fade in and fade out in pure javascript without jquery

会有一股神秘感。 提交于 2019-12-05 07:06:38
Here I have a function that fades a square box with id="box" as soon as the page loads. I tried but failed to find out how to fade in the box again or simply how to fade in a box or an element with pure JavaScript not jQuery. Here is my code for fadeOut() function: var box = document.getElementById('box'); function fadeOut(elem, speed) { if(!elem.style.opacity) { elem.style.opacity = 1; } setInterval(function(){ elem.style.opacity -= 0.02; }, speed /50); } fadeOut(box, 2000); #box { width: 100px; height: 100px; background-color: blue; } <div id="box"></div> Many thanks in advance to

Fading a picture gradually

馋奶兔 提交于 2019-12-05 06:42:32
The idea of this function is to fade the top half only of the picture (make it gradually darker). Here is what I have but it seems to be making all of the top half solid black. def fadeDownFromBlack(pic1): w=getWidth(pic1) h=getHeight(pic1) for y in range(0,h/2): for x in range(0,w): px=getPixel(pic1,x,y) setBlue(px,y*(2.0/h)) setRed(px,y*(2.0/h)) setGreen(px,y*(2.0/h)) Let's look at just one line here: setBlue(px,y*(2.0/h)) and key part here is y*(2.0/h) y changes, as you go down. Let's try some simple values for y and h. Let's say h is 100 and we will examine when y is both 0 and 50 (h/2).

Rotating text with Javascript

独自空忆成欢 提交于 2019-12-05 05:35:34
I'd like to cycle through an array of words creating a text rotation affect. I have most of it working as expected. Is there any way I can use a css transition on the length of the p element? When traversing from an object with char.length > 10 to an object with char.length < 5 (for example) the movement isn't smooth and I'd like to ease the movement of the text around the word rather than abruptly jumping backwards (or forwards depending on the length of the word) HTML: <p><span id="description-rotate"></span> something built on something else.</p> SASS: @-webkit-keyframes rotate-text 0%

Jquery hover fadeIn/fadeOut problem

让人想犯罪 __ 提交于 2019-12-05 02:34:33
问题 http://www.izrada-weba.com/orso On mouseover on link "NENATKRIVENA TERASA..." submenu and image fade in together. Submenu is faded using some downloaded script and image above is fading using my code: $(document).ready(function () { $("#slika1").hide(); $("#test,#submenu2").hover( function () { $("#slika1").fadeIn(); }, function () { $("#slika1").fadeOut(); } ); }); When mouse is over link than image fades in, and when mouse is moved to submenu image fades out and than fades in again... I

Slowly change/fade/animate an image changing with JQuery

做~自己de王妃 提交于 2019-12-05 02:20:11
This is my img, <img src="one.png" id="one" onMouseOver="animateThis(this)"> I want to slowly change this image src to "oneHovered.png" when the user hovers over using jQuery. Which jQuery method is best to do this? A lot of examples I see want me to change the CSS background. Is there anything to alter the src attribute directly? jmort253 You could start by first fading out the image, controlling the duration of the fadeout using the first optional parameter. After the fade out is complete, the anonymous callback will fire, and the source of the image is replaced with the new one. Afterwards,

jQuery - How to fade in/out from one color to another? (possible 3rd party plugin fo jQuery?)

南笙酒味 提交于 2019-12-05 01:52:34
I'm looking for a jQuery script or a 3rd party plugin for jQuery, which can create a fade in/out effect based on "from color" and "to color". Example how I see it: $( selector ).fadeColor({ from: "#900", // maroon-red color to: "#f00", // blood-red color }, 3000); // last argument is the time interval, in milliseconds in this particular case it's based for 3 seconds jQuery UI extends jQuery's animate method to include colour animation. You can then do something like: $("#someId").animate({backgroundColor: "#ff0000" }); Here's a working example . You don't need another plugin. Example: jQuery $