Fade in object cript

jimbush3
Community Member Posts: 15
The first script here only works in IE.The second script is barely longer and has been tested on IE, Firefox, and Netscape Navigator. //This function controls fade on most browsersfunction changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } //Set fade area to size of Fade In Objeact External HTML Objectdocument.write('
');document.write('
'); //Change 2000 to change the speed of the fade var speed = Math.round(2000 / 100); var timer = 0; //This loop can be reversed to fade out instead of in for(i = 100; i >= 0; i--){ setTimeout("changeOpac(" + i + ",'fadehere')",(timer * speed)); timer++; } Edited By: jimbush3 on 2008-2-14 13:46:58 Categories
- 35.9K All Categories
- 109 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 29K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 25 ELB Learning Content
- 25 ELB Learning Content Discussions
- 328 CenarioVR®
- 195 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 42 Rockstar Learning Platform®
- 39 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 936 All Things eLearning
- 37 eLearning Development
- 546 Learning Management System (LMS) Integration
- 333 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products