Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Javascript: Fade Out onpageload
Old 06-11-2009, 01:59 PM Javascript: Fade Out onpageload
mb2000inc's Avatar
Extreme Talker

Posts: 150
Name: Mark
Location: Ohio
Trades: 0
Ok, I have this code. I'm using a Script.acul.ous library. (You can download the zip file and copy the "prototype.js" file from the "lib" folder and all the other files from the "src" folder into a "js" folder in your project.) To do a fade out effect on a <div> tag after a specified amount of time.

What happens is this:
On my internal network, the timer used works great!

On the outside - the <div> cuts out earlier than on the inside. I'm sure it's something simple that I'm overlooking... and it probably has to do with how fast the browser(s) load the pages.

This is the code I'm using (taking into consideration other browser types):
(please keep in mind that you need the other files from the above mentioned zip files in your "js" folder for them to be called on)
Code:
 <script type="text/javascript" src="js/prototype.js"></script>
    <script type="text/javascript" src="js/scriptaculous.js"></script>
        <script type="text/javascript">
   <!--
   var browserName=navigator.appName; 
    if (browserName=="Microsoft Internet Explorer")
    {
       Event.observe(window, 'load', function() {
                var fade=setTimeout("fadeout()", 41500);
                var hide=setTimeout("$('DIVNAME').hide()", 42500);
            });
 
            function fadeout(){
                new Effect.Opacity("DIVNAME", {duration:1.0, from:1.0, to:0.0});
            }
    }
    else
     {
            Event.observe(window, 'load', function() {
                var fade=setTimeout("fadeout()", 40400);
                var hide=setTimeout("$('DIVNAME').hide()", 41500);
            });
 
            function fadeout(){
                new Effect.Opacity("DIVNAME", {duration:1.0, from:1.0, to:0.0});
            }
      }
   //-->
        </script>
Like I said, internally, it works great in IE, FF, and Safari (for Windows). But outside the network, it's cutting out earlier than anticipated... any thoughts?

I can show you an example, but the site is for work and I would need strictest confidentiality on it (as it's not completely live, yet and is in stage to go live next week)... if you agree to that, I'll furnish you with the link (privately).
__________________
Need a vacation.
mb2000inc is offline
Reply With Quote
View Public Profile Visit mb2000inc's homepage!
 
 
Register now for full access!
Reply     « Reply to Javascript: Fade Out onpageload
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28229 seconds with 12 queries