10 examples of 'bootstrap fadein' in JavaScript

Every line of 'bootstrap fadein' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
72function fadeIn(element, callback) {
73 var currentOpacity = getStyle(element, 'opacity') || 1;
74 var display = getStyle(element, 'display');
75 if (display === 'none') {
76 element.style.display = 'block';
77 currentOpacity = 0;
78 }
79 var opacity = Number(currentOpacity) + fadingStep;
80 element.style.opacity = opacity > 1 ? 1 : opacity;
81 setTimeout(function () {
82 if (opacity < 1) {
83 fadeIn(element, callback);
84 } else {
85 typeof callback === 'function' && callback();
86 }
87 }, 10);
88}
1function fadeIn() {
2 var h = document.querySelector(".picture");
3 var opacity = parseFloat(h.style.opacity);
4 if(opacity < 1) {
5 opacity = opacity + 0.1;
6 h.style.opacity = opacity;
7 window.setTimeout(fadeIn, 33);
8 }
9}
86export function fadeIn (el, duration = 400, callback) {
87 if (!el.style.opacity) {
88 el.style.opacity = 0;
89 }
90
91 let start = null;
92 window.requestAnimationFrame(function animate (timestamp) {
93 start = start || timestamp;
94 const progress = timestamp - start;
95 const opacity = parseFloat(progress / duration, 2);
96 el.style.opacity = opacity > 1 ? 1 : opacity;
97 if (progress > duration) {
98 if (callback && typeof(callback) === 'function') {
99 callback();
100 }
101 } else {
102 window.requestAnimationFrame(animate);
103 }
104 });
105}
394fadeIn: function fadeIn() {
395 this.el.offsetWidth;
396 this.el.style.opacity = this.instance.options.bgOpacity;
397},
498value: function fadeIn(el) {
499 var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.1;
500 var display = arguments[2];
501
502 el = this.s(el)[0];
503 el.style.opacity = 0;
504 el.style.display = display || "block";
505
506 (function fade() {
507 var val = parseFloat(el.style.opacity);
508 if (!((val += i) > 1)) {
509 el.style.opacity = val;
510 requestAnimationFrame(fade);
511 }
512 })();
513}
1549AppWindow.prototype.fadeIn = function aw__fadein() {
1550 if (this.isActive()) {
1551 this.element.classList.remove('fadeout');
1552 this.debug(' fade in <<<<< ');
1553 }
1554};
11function fadeIn(view, duration) {
12 anim.fadeIn(view, duration, function() {
13 fadeOut(view, duration);
14 });
15}
232(function fade() {
233 var val = parseFloat(el.style.opacity);
234 if (!((val += 0.1) > v)) {
235 el.style.opacity = val;
236 requestAnimationFrame(fade);
237 }
238})();
257fadeIn() {
258 this.reflow()
259 addClass(this.classes.READY, this.slide)
260}
73function fadein(element) {
74 element
75 .style('opacity', 0)
76 .transition()
77 .duration(150)
78 .ease('linear')
79 .style('opacity', 1);
80}

Related snippets