fade

Fade only top part of div out as it reaches fixed navigation

你离开我真会死。 提交于 2019-12-06 10:13:20
I'm trying to fade the top part of my content as it reaches a fixed nav bar with a translucent background. I've got it somewhat working, but you'll see 2 problems: All the content fades out, not just what's approaching the fixed nav. Content should fade at a line by line rate. All the content for all the other divs fade about because of the selector class. I'd appreciate any help! Thanks var divs = $('.section').children(); $(window).on('scroll', function() { var st = $(this).scrollTop(); divs.css({ 'opacity' : (1 - st/20) }); }); JS Fiddle so far: http://jsfiddle.net/x5JKC/ I changed a bit

jQuery - divs not fading out completely before next starts fading in

被刻印的时光 ゝ 提交于 2019-12-06 05:04:53
The problem is a simple one, I know, but I'm having a heck of a time trying to figure it out. I have 8 divs on a page that hold image galleries which start off hidden. When a user clicks on an icon to view a gallery, the first gallery they chose fades in all shiny. But when they choose another, the one they were viewing begins to fade out while the other fades in below it, and then moves up into its correct position as the first div is hidden. See jsfiddle . So, my question is apparent: How do I get the gallery they were viewing to fade out completely before the next one fades into the correct

jQuery fading/dimming other list elements when one is hovered over, I'm 90% there..?

∥☆過路亽.° 提交于 2019-12-06 04:28:43
I have an unordered list, which has maybe 30 items. When one of these items are hovered over, the rest of the list items fade to 30% and the hovered item stays at 100%; when you move away from the list, they all fade back up to 100% and I have managed this. My problems arises when you move from item to item, the other list items fade back up to 100% and then back down to 30%. I want them to stay at 30% unless the user moves away from the whole list. I use the hoverIntent plugin on each list item. I also used jQuery to add a class to the current list item, so I could then fade the rest and

jQuery cross fading two images on a loop!

为君一笑 提交于 2019-12-06 04:03:30
问题 I am having trouble working out how to get a simple fade in fade out loop to work. I am pretty new to jQuery as you can maybe tell. I have had a go at it but now it’s taking too long to work out so I thought I would ask for some help. What I want to do: I have two Images, id's #img1 and #img2. I want image 1 to fadeIn then wait for lets say 6 seconds then fade out. I have tried the .wait function but it just stopped the little I had from working. I managed to get the first image to fade in

How to replace ellipses with fade / fading edge in textview in Android sdk?

拜拜、爱过 提交于 2019-12-06 03:52:21
问题 I have a list, each row in the list has text. Some of the text extends beyond the edge of the screen. I have no problem making it truncate the text and show ellipses. I have no problem to 'fade the edge of the text' however, the fade occurs at the edge of every text, not just the ones the are too large for the textview. I have searched and searched and can't find a way to, essentially, do exactly what the ellipses do but, instead of ellipses, fade the edge of the text only if it is going off

Vue动画封装

耗尽温柔 提交于 2019-12-06 03:22:05
<head> <meta charset="UTF-8"> <title>Title</title> <script src="vue.js"> </script> </head> <body> <section class="app"> <fade :showw="show"> <article >hi</article> </fade> <button @click="handle">Select</button> </section> <script> Vue.component("fade", { props:["showw"], template: `<transition @before-enter="hanle" @enter="handleenter" @after-enter="after"> <slot v-if="showw"></slot> </transition>`, methods: { hanle: function (el) { el.style.color = "blue" }, handleenter: function (el, done) { setTimeout(() =>{ el.style.color= "green" },2000) setTimeout(() =>{ done() },4000) } } }) var vm =

Fade in dynamically generated content with Bootstrap 3

╄→尐↘猪︶ㄣ 提交于 2019-12-06 01:20:08
I've read several similar questions on SO regarding Bootstrap's fade classes, but none of them seem to address my issue. I understand that the fade animation in Bootstrap 3 works by switching opacity between 0 and 1 when you add the .in class to an element that already has a .fade class. This works fine for me when dealing with an element that already exists in the HTML (for example, this JS Fiddle demo ). The problem is that the transition doesn't seem to happen when the element is created dynamically with Javascript. For example, the following code will create and display an alert, but the

jQuery randomly fadeIn images

喜欢而已 提交于 2019-12-06 00:33:30
问题 I have a container with a lot of small images. <div id="container"> <img src="1.jpg" /> <img src="2.jpg" /> <img src="3.jpg" /> ... <img src="100.jpg" /> </div> I set opacity to 0. (not hidding) Then I want to show(fadeIn) random image after half second. for example 5th, 1st, 55th ... Any suggestions, thanx a lot 回答1: try this <script type="text/javascript"> //generate random number var randomnumber=Math.floor(Math.random()*$("#container").children().length); $(function() { //hide all the

Image Replacement (gallery style) with Fade-In's / Fade-Out's

让人想犯罪 __ 提交于 2019-12-06 00:14:08
I'm sure you've all seen this demo of image replacement using this : $("#largeImg").attr({ src: largePath, alt: largeAlt }); http://www.webdesignerwall.com/demo/jquery/img-replacement.html So, imagine that I want to change 4 images on the screen to simulate that I am changing the entire 'page' , but avoiding using AJAX / PHP or any image preloaders. The problem I am having right now with my code : <script> $(document).ready(function(){ $(".navlink").click(function(){ var theirname = $(this).attr("name"); var imagepath = "images/img_"+theirname+".jpg"; var headerpath ="images/header_"+theirname

vue 动画原理 part1

风格不统一 提交于 2019-12-05 23:51:23
Vue动画原理 增加和删除css增加样式实现一个过渡效果也就是动画效果 1.需要动画效果的标签外包裹一个transition标签 会被自动分析css样式,然后自动构建一个动画流程 transition标签中 name=“fade”如果不写默认v 1.动画即将执行的时候增加两个css fade-enter fade-enter-active 2.第一帧执行完毕。vue会增加一个css fade-enter-to 删除fade-enter 3.最后一帧,会去掉所有添加的css 上面是显示步骤 ,下面是隐藏步骤 来源: https://www.cnblogs.com/-constructor/p/11951244.html