fade

How to use jQuery to fade in/out li a:hover css background-color?

青春壹個敷衍的年華 提交于 2019-12-07 10:43:27
问题 I have been struggling with a problem for a couple of days now with no success so decided to sign up here and see if some kind soul can help me out. Fingers crossed! I am trying to animate (fade in/out) the css background-color of a link in an unordered list when it is hovered over. It is essential to maintain the unordered list structure so I am not looking for a solution that separates each link into it's own div and animates the background colour of that. I would also like to restrict the

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

半腔热情 提交于 2019-12-07 10:12:36
问题 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

How to cross fade between AVAudioPlayers

浪子不回头ぞ 提交于 2019-12-07 08:28:52
问题 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. 回答1: 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.

Add alpha to shader in Unity3D

风流意气都作罢 提交于 2019-12-07 07:58:56
问题 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" =

HTML/CSS - create alpha mask over image

坚强是说给别人听的谎言 提交于 2019-12-07 06:38:42
问题 I'd like to create an effect in a site I’m building where an image is masked by an overlay. The overlay should create a “fade out” effect — I don’t actually want anything animated, but the overlay should make the image look as if it’s fading to the background colour at the edges. Something like this: http://imgur.com/fqtc9.png I prefer to do this with CSS/HTML/JS - not images. Any thoughts on where to start? Thanks. 回答1: you could do something like this for example : Example html <div class=

fade in and fade out in pure javascript without jquery

我们两清 提交于 2019-12-07 03:35:55
问题 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:

Fading a picture gradually

荒凉一梦 提交于 2019-12-07 02:36:55
问题 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)) 回答1: 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

Rotating text with Javascript

若如初见. 提交于 2019-12-07 01:44:59
问题 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=

Twitter Bootstrap - why is my modal as faded as the background?

我是研究僧i 提交于 2019-12-06 16:52:29
问题 So I'm using Twitter Bootstrap and I have a modal that slides down when the user clicks the "Register" button. The only problem is that the not only does the background page fade, which is a nice effect, but the modal is also faded. How can I get it so that the modal is normal brightness while the background is faded? I created a JSFiddle to demonstrate my problem here: http://jsfiddle.net/jononomo/7z8RZ/7/ The following code creates a faded modal: <div class="navbar navbar-fixed-top"> <a

jQuery: How to use fadeToggle()?

吃可爱长大的小学妹 提交于 2019-12-06 13:32:41
I want to use jQuery's fadeToggle() function. I have a hidden div and when I click on a link, then I want to call fadeToggle() that the div fades in and after another click fades out. The clue is, that i want to resize the window after clicking with my own function (which is working well). At the moment I have this solution: jQuery: $("#myLink").live("click", function () { $("#myDiv").toggleClass("myDivClass"); Resize(); }); Css: <style type="text/css"> #myDivclass { display:none; } </style> It works perfectly, but I want to do the same thing with fadeToggle() instead of toggleClass() . The