How to display js control elements on fixed position of the screen and monitor screen height changes
This article describes the method of displaying js control elements on fixed positions of the screen and monitoring screen height changes. Share it for your reference. The details are as follows:
//Control the display position of the logo Begin("resize", function () { // Get screen size (internal/external width, internal/external height) changeLogoPosition(); }, false); changeLogoPosition(); function changeLogoPosition() { var contentHeight = $("#main_content_div").css("height"); var logoHeight = $("#third_party_logo").css("height"); contentHeight = parseInt(('px', '')); logoHeight = parseInt(('px', '')); //alert('Screen height: '++' Content height: '+contentHeight+' logo height: '+logoHeight); if ( - contentHeight > logoHeight) { ('third_party_logo'). = 'absolute'; } else { ('third_party_logo'). = ''; } } //Control the display position of the logo End
I hope this article will be helpful to everyone's JavaScript programming.
Related Articles
Detailed explanation of StepJump component instance with multiple steps and multiple steps in JS
This article mainly introduces the detailed explanation of StepJump component instance in JS.2016-04-04js check start time and end time
This article mainly introduces the start and end time of js verification. The sample code in the article is introduced in detail and has a certain reference value. Interested friends can refer to it.2020-05-05JavaScript method to implement delayed loading of iframe framework
This article mainly introduces the method of JavaScript to implement delayed loading of iframe frameworks. This function can be implemented based on setTimeout. It is a very practical technique. Friends who need it can refer to it.2014-10-10Loopless JavaScript (map, reduce, filter, and find)
This article introduces map, reduce, filter and find functions from a shallow to deeper level, how to extract loops from the code step by step2017-04-04WeChat applet custom address component
This article mainly introduces the customized address components of WeChat applets in detail. The sample code in the article is introduced in detail and has certain reference value. Interested friends can refer to it.2022-07-07Table freezes the header sample code
Table freezes the table header, everyone should not be unfamiliar with this, the implementation is very simple. Here is a detailed introduction to the specific implementation. Interested friends can refer to it.2013-08-08The -S and -D parameters after npm are explained in detail.
This article mainly introduces relevant information about the detailed explanation of the -S and -D parameters after npm. The article also introduces some differences between npm -s and -d, which has a certain reference class value for everyone's study or work. Friends who need it can refer to it.2024-01-01Native JS implements multi-condition filtering
This article mainly introduces the implementation of multi-condition filtering in native JS. The sample code in the article is introduced in detail and has a certain reference value. Interested friends can refer to it.2020-08-08Multi-level drop-down menu for JavaScript implementation
This article mainly introduces the multi-level drop-down menu for JavaScript implementation control, including sample code, and the effect is very good. Here we recommend it to everyone.2015-07-07Detailed explanation of the usage of return in JavaScript
This article mainly introduces the usage of return in JavaScript, including return definition, writing, etc. Friends who need it can refer to it2017-05-05