fadeIn() element with opacity:0 [duplicate]

212
November 28, 2016, at 10:00 PM

This question already has an answer here:

  • css() and opacity.. following fadeIn() not working 3 answers

Why fadeIn() function doesn't perform the show animation for the element which already has opacity:0?

<span style="display:none;opacity:0">some text</span>
<script>
    $("span").fadeIn(3000) /* id doesn't show the element. JQuery function just removes display:none, but opacity is still 0 */
</script>

I know, I can call fadeTo() but I want to know what is going on.

Answer 1

You forgot to show the element before

$("span").show().fadeIn(3000);
READ ALSO
setting html values on separate page with jquery

setting html values on separate page with jquery

How would you set the html values of one page from another after running an ajax call? I want to run the ajax call, based on this information, set the values of another page then jump to that new pageI'm using window

257
Prevent Javascript confirm() on Checkbox State Change

Prevent Javascript confirm() on Checkbox State Change

I have a checkbox (which uses the Bootstrap Switch library to act as an on/off toggle) to activate and deactivate users with the help of AJAX

421
Removing parameters from url using jQuery or JavaScript

Removing parameters from url using jQuery or JavaScript

Hello stackoverflow communityI need ideas and help

426