Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 793025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:05:09+00:00 2026-05-14T22:05:09+00:00

I had a problem and whipped up a quick solution: fade-in and fade-out a

  • 0

I had a problem and whipped up a quick solution: fade-in and fade-out a series of quotations. My solution works just as I want it in every browser except any of the IEs. The only problem with the IEs is that the text does not fade in and fade out; the text simply pops into existence.

I believe I’ve run into a similar problem before when trying to dynamically change the filter:alpha(opacity=xx) of an element.

Any help is greatly appreciated!

<html>
<head>
<style>
.fadetext{
background:green;
border:1px solid red;
height:50px;
width:500px;
}

.fadetext div{
background:yellow;
}
</style>
<script type="text/javascript">
var CI_common = {
    C:function(cls,elm){
        if(!elm) elm = document;
        if(document.getElementsByClassName){
            return elm.getElementsByClassName(cls);
        }else{
            var t = [];
            var o = elm.getElementsByTagName("*");
            var r = new RegExp("(^|\\s)" + cls + "($|\\s)");
            for(var i=0;i<o.length;i++){
                if(o[i].className.match(r)) t.push(o[i]);
            }
            return t;
        }
    },

    eventAdd:function(obj,evt,func){
        if(obj.addEventListener){
            obj.addEventListener(evt,func,false);
        }else if(obj.attachEvent){
            obj["x" + evt + func] = func;
            obj[evt + func] = function(){
                obj["x" + evt + func](window.event);
            }
            obj.attachEvent("on" + evt,obj[evt + func]);
        }
    }
}

var CI_fadetext = {
    init:function(){
        var c = CI_common.C("fadetext"); // Simply a getElementsByClassName function
        for(var i=0;i<c.length;i++){
            c[i].style.overflow = "hidden";
            var kids = c[i].getElementsByTagName("div");
            for(var j=0;j<kids.length;j++){
                kids[j].style.display = "none";
                kids[j].style.filter = "alpha(opacity=0)";
                kids[j].style.opacity = "0";
                (function(obj,index,len){
                    obj.fadetexttimeout = setTimeout(function(){
                        CI_fadetext.fade(obj,true);
                        obj.fadeininterval = setInterval(function(){
                            CI_fadetext.fade(obj,true);
                        },5000*len)
                    },5000*index);
                    setTimeout(function(){
                        CI_fadetext.fade(obj,false);
                        obj.fadeoutinterval = setInterval(function(){
                            CI_fadetext.fade(obj,false);
                        },5000*len)
                    },5000*index+4400);
                })(kids[j],j,kids.length);
            }
        }
    },

    fade:function(elm,dir){
        function fade(start){
            start = (dir ? start + 10 : start - 10);
            elm.style.filter = "alpha(opacity=" + start + ")";
            elm.style.opacity = start/100;
            document.getElementById("output").innerHTML = elm.style.filter;
            if(start > 100 || start <0){
                elm.style.display = (dir ? "" : "none");
                elm.style.filter = "alpha(opacity=" + (dir ? 100 : 0) + ")";
                elm.style.opacity = (dir ? 1 : 0);
            }else elm.fadetexttimeout = setTimeout(function(){fade(start);},50);

        }
        if(dir){
            elm.style.display = "";
            fade(0);
        }else fade(100);
    }
}

CI_common.eventAdd(window,"load",CI_fadetext.init); // Just a window.onload level 2 event listener
</script>
</head>
<body>
<div id="output"></div>
<div class="fadetext">
    <div>AAAA</div>
    <div>BBBB</div>
    <div>CCCC</div>
    <div>DDDD</div>
    <div>EEEE</div>
</div>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:05:09+00:00Added an answer on May 14, 2026 at 10:05 pm

    Set the value to the filter array rather than the style element. Then IE be able to keep up.

    if (elm.filters)
    elm.filters[0].opacity=value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a problem where I had a series of overlapping CATransition / CAAnimation
i had a problem with a NSMutableURLRequest, i want to translate this curl -b
Edit: this code actually works. I had problem in the code that used it.
_ I had problem with installing the mod_wsgi.I have found the solution as below
I wrote simple class in JS witch works, but i had problem when i
I had problem triggering server side button click events so I found a solution
I just recently had problem accessing the getSizes API. I tested it in flickr
Had a problem with the recursive conflictCheck() method. That seems fine now. I have
I had this problem before and can't for life of me remember how to
I had no problem at all running the following code on a local server,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.