Interpretation of m$ Source code: JavaScript + CSS implementation layer translation and dynamic display

Source: Internet
Author: User
<!--interpretation m$ source code: JavaScript + CSS implementation layer translation and dynamic display-->
<!--open.htm-->
<!--This article mainly by JavaScript and CSS implementation of layer translation and dynamic display-->
<!--little Brother's JavaScript level is really bad enough, so the following annotations are personal understanding, there are omissions and improper place also please you to correct the-->
<!--The following source code originates from the DISCOVER directory of the m$ Windows Professional installation CD, where changes are shown in the document's most annotated-->
<script language= "JavaScript" >
var StarTV = 0.5;
var endv = 1;
var Midv;
var Inc = 0.12;
var power = 3;
/* INC and power to control the change of alpha per cycle and the total number of cycles * *
var mSec = 20;
var Slstartv;
var slendv;
var slinc;
var MSec;
var opensec = 20;//time required to complete the control cycle
var slpower;
function Fadelogo () {
if (Endv > 9999) {
StarTV = StarTV + Inc;
Midv = Math.sin (STARTV) + 1;
ENDV = Math.pow (midv,power);
* * Personally think that the form such as "int i;i=1;i++" way to define ENDV, can also achieve the effect of alpha change, but that is only a uniform change, less than the use of the dynamic just * *
document.all.brandLogo.filters.alpha.opacity = document.all.brandLogo.filters.alpha.opacity + endv;
document.all.Discover.filters.alpha.opacity = document.all.Discover.filters.alpha.opacity + endv;
document.all.Marketing.filters.alpha.opacity = document.all.Marketing.filters.alpha.opacity + endv;
/* To achieve the continuity of alpha and translation, you can also add a constant after ENDV, so the control will be easier
alert (document.all.Discover.filters.alpha.opacity);
* * As my general Rookie, alert method can be used to track a variable to achieve the desired effect, just be careful not to appear dead cycle, then don't scold me Oh ~ ~
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.