fade

Fade HTML element with raw javascript

落花浮王杯 提交于 2019-12-28 13:57:25
问题 It's my second question of the day related to the same problem, so I apologize for that. I was able to put together a function to "fade out" an element, and it works just fine, my problem is that when I try to reverse it, so the element "fades in" it does not work. I've tried to change the obvious, but I can't understand what I'm doing wrong. My code so far is as follows: Given I have a "div" like so: <div id="test" style="width:200px; height:200px; display:block; opacity:1; background-color

Fade HTML element with raw javascript

若如初见. 提交于 2019-12-28 13:57:10
问题 It's my second question of the day related to the same problem, so I apologize for that. I was able to put together a function to "fade out" an element, and it works just fine, my problem is that when I try to reverse it, so the element "fades in" it does not work. I've tried to change the obvious, but I can't understand what I'm doing wrong. My code so far is as follows: Given I have a "div" like so: <div id="test" style="width:200px; height:200px; display:block; opacity:1; background-color

Fade the background-color of a span tag with JQuery

非 Y 不嫁゛ 提交于 2019-12-28 13:40:31
问题 I'm trying to fade the background-color of a span tag using JQuery to emphasize when a change has occured. I was thinking the code would be someting like the following inside the click handler, but I can't seem to get it working. Can you show me where I went wrong? Thanks Russ. $("span").fadeOut("slow").css("background-color").val("FFFF99"); That's better, but now it fades both the background-color of the span tag and the text value of the span tag too. I'm trying to just fade the background

fadeOut() and slideUp() at the same time?

瘦欲@ 提交于 2019-12-28 03:33:26
问题 I have found jQuery: FadeOut then SlideUp and it's good, but it's not the one. How can I fadeOut() and slideUp() at the same time? I tried two separate setTimeout() calls with the same delay but the slideUp() happened as soon as the page loaded. Has anyone done this? 回答1: You can do something like this, this is a full toggle version: $("#mySelector").animate({ height: 'toggle', opacity: 'toggle' }, 'slow'); For strictly a fadeout: $("#mySelector").animate({ height: 0, opacity: 0 }, 'slow');

CSS fade left to right

回眸只為那壹抹淺笑 提交于 2019-12-28 02:08:46
问题 Is there a way to fade elements (at least just text) in and out going left to right or vice-versa using only CSS? Here is an example of what I mean: Actually, if it requires jQuery, I'll accept that too, just as a second priority. 回答1: Yes, you can do it with CSS3 animations (check browser support here). Here's a simple demo for text-fading. HTML: .text { position:relative; line-height:2em; overflow:hidden; } .fadingEffect { position:absolute; top:0; bottom:0; right:0; width:100%; background

Fade between pages using jquery

丶灬走出姿态 提交于 2019-12-25 12:49:08
问题 I'm trying to add a transition effect to my site with Jquery. Everything was working, but suddenly the site started flickering one time before the fade in effect... I add a display:none and it was solved. But if visitors have JavaScript disabled, they won’t be able to view the site. I've already add it as a script but it doesn't work... Any ideas? Here is my fade code: <!--transition--> <script type="text/javascript"> $(document).ready(function() { $("body").css("display", "none"); $("img")

How do you apply a fading overlay to an image in CSS?

那年仲夏 提交于 2019-12-25 05:18:45
问题 I have an image inside a div . For example's sake, let's say this div has a background-color of #000 . Now, I want this image to fade from the left, to the right. What I mean is, the first column of pixels should appear to have 100% opacity, whilst the final column of pixels should appear to have 0/1% opacity (the final column of pixels will blend in with the background of the div). How would I do this purely in CSS? The image will always be 50x50. 回答1: you could overlay div on top of an

JQuery mouseout timeout

☆樱花仙子☆ 提交于 2019-12-24 19:19:05
问题 Similar problems have been dealt with before but I believe mine's slightly different owing to the use of the bind() function. Anyhow... $('.overlay').bind("mouseenter",function(){ $(this).fadeTo('slow', 0); }).bind("mouseleave",function(){ setTimeout(function() { $(this).fadeTo('slow', 1); }, 2000); }); I want to fade out the overlay on "mouseenter", but only fade it back in 2000ms after "mouseleave". I have an additional question: When the .overlay div fades out, I need to be able to click

Is possible use fade transition on tag 'content' only with css?

大憨熊 提交于 2019-12-24 13:17:21
问题 Please view this code jsfiddle: http://jsfiddle.net/rflfn/6wCp6/ <div id="menu"> <ul> <li><a href="#">Link #1</a></li> <li><a href="#">Link #2</a></li> <li><a href="#">Link #3</a></li> <li><a href="#">Link #4</a></li> </ul> </div> CSS: *{ margin: 0; padding: 0; text-decoration: none; font-family: arial; font-size: 16px; } a{ color: #000000; } a:hover{ color: #860000; } #menu{ margin: 15px auto; padding: 20px; width: 300px; background: #DDDDDD; border-radius: 5px; box-shadow: 0 0 5px #000000;

How to make an option fade but still be clickable on Android Studio?

元气小坏坏 提交于 2019-12-24 11:20:13
问题 I currently have a two checkboxes, where when one is clicked, the other automatically unchecks. I would like to keep that however have the unchecked one become a faded white color, yet still be clickable and readable if the user decides to change his/her mind. This is the current code I have: chk1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { if (CheckBox.isChecked(chk1)) { chk2