Full-screen floating advertisement Based on javascript _ javascript skills

Source: Internet
Author: User
This article mainly introduces how to implement full-screen floating Advertisements based on javascript, and stop moving the cursor floating advertisements, which has a certain reference value, if you are interested, you can refer to the examples in this article to share with you how javascript achieves full-screen floating advertisements for your reference. The specific content is as follows:

Main usage

Visible area width of the webpage: document. body. clientWidth;
Visible area height: document. body. clientHeight;

Visible area width of the webpage: document. body. offsetWidth (including the width of the edge );
Visible area height of the webpage: document. body. offsetHeight (including the width of the edge );

SetInterval

The setInterval action is used to call a function, method, or object every certain time when an animation is played. You can use this action to update the variables or update time display from the database.

The syntax format of the setInterval action is as follows:

 setInterval(function,interval[,arg1,arg2,......argn])   setInterval(object,methodName,interval[,arg1,arg2,.....argn])

The first format is the default syntax of the setInterval function in the standard action panel, and the second format is the method used in EXPERT mode actions.
The Parameter function is a function name or a reference to an anonymous function.
The object parameter specifies the Object derived from the object. MethodName specifies the method to be called in the object parameter.
Interval specifies the time between two calls to a function or methodName, in milliseconds. The following arg1 and so on are optional parameters used to specify the parameters passed to the function or methodName.
SetInterval: the time interval set by setInterval is smaller than the animation frame rate (for example, 10 frames per second, equivalent to 100 milliseconds), and the function is called at the interval as close as possible to interval. The updateAfterEvent action must be used to ensure that the screen is refreshed at sufficient frequency. If interval is greater than the animation frame speed, it is called only when the playback header enters a certain frame to reduce the impact of screen refreshing.

ClearInterval

The clearInterval action is used to clear the call to the setInterval function.

Its Syntax format is as follows:
ClearInterval (intervalid); // intervalid is the object returned after the setInterval function is called.

Advertisement mobile effect instance

      
     Simple JS animation instance advertisement moving Effect        

Mobile Advertisement

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.