A large number of high-resolution images can make a Web site shine. However, the Website access speed may also decrease. If the image is a file, the file will occupy the bandwidth, and the bandwidth is directly related to the access wait time. Now,
Positon: fixed isolates HTML elements from the document stream at a location in the browserThis positioning mode is often used for floating navigation bars on webpages, but this positioning mode is not compatible with ie6.Position: fixed; bottom:
When the address bar contains parameters, we can use window. location. search on the target page to obtain the required parameters and their values.Copy codeThe Code is as follows:// Obtain the parameter array in the address barFunction getUrlParams
Generally, server developers write a simple interface description page after writing the background information, which is similar:Copy codeThe Code is as follows: param_1 param_2 param_3 param_4 Because the results are returned in
When I saw the phpcms cascade menu, I thought it was quite interesting to write it. I just talked about the general steps, saving my mind.The cascade menu is usually generated in the areaid () function of the/data/cache_model/content_form.class.php
The following describes the implementation process.
HTML Tag structure:
Copy codeThe Code is as follows: menu 1 menu 1 menu 2 menu 2 menu 3 menu 3 menu 4 menu 4
CSS style:Li style:
Copy codeThe Code is as follows:. Animation_menu li {/*
In JS, you can set style. display or style. the visibility attribute is used to control whether the elements are displayed. display = block and style. when visibility = visible, the element is displayed in style. display = none and style. when
Copy codeThe Code is as follows:/*** Convert a date to a timestamp* Date Format: 21:12:13* Time_str: Date segment* Fix_time: 21:12:13*/Function strtotime (time_str, fix_time ){Var time = (new Date (). getTime ();
If (time_str) {// Date segmentVar
I. requirements and problems
The iframe framework layout is used in the background management of the website, including the top menu, left navigation, and home page. Requirement: click a button on the home page, and the "exit" link is displayed on
CauseOne important reason for organizing code into a class is to make the code more "modular" and implement code reuse in many different scenarios. However, classes are not the only way to modularize code.
Generally, a module is an independent JS
Source code download
BxCarousel parameter description:
Move: the number of images to be moved each time. The default value is 4.
Display_num: Number of displayed images. The default value is 4.
Speed: The image scrolling speed. The default value is 5
Problem:Recently, jqeury's validationEngine was used for ajax verification. When the last field in the form needs to be used for ajax verification, it does not work when you press enter to submit the form after the field is entered, you must click
When you create a form page, you need to determine whether the two js objects are identical.Here is the solution on stackoverflow. Record it here.Copy codeThe Code is as follows:Object. prototype. equals = function (x){Var p;For (p in this ){If
Define privileged Methods Within the constructor, a method defined by the this keyword can be called by inheriting the instantiated object.Copy codeThe Code is as follows:Var Student = function (name ){Var _ name = name; // Private Attribute//
Preface
Basically, all JS data types have these two methods, except null. They solve the javascript value calculation and display problems. Rewriting will increase the optimization of their calls.
Test Analysis
Let's take a look at the following
Throttle Ignoring all calls within a certain period of time is suitable for use when the frequency is high and the processing is heavy.Copy codeThe Code is as follows:Var throttle = function (func, threshold, alt ){Var last = Date. now ();Threshold =
The current page has a variety of page effects, commonly used pop-up layer effects, seamless scrolling effect, Tab switching effect. Today, I will share a switch between tabs written in native javascript. Due to my limited level, please note if you
Copy codeThe Code is as follows: This is the first divThis is the second divThis is the first spanThis is the first span + eric sun class.This is the eric sun class. Copy codeThe Code is as follows:$ (". First_div,. first_span ") Obtain all objects
Using JS to display the picture on the left and right arrows Page code, preview effect Web site: http://www.keleyi.com/keleyi/phtml/picnext/This example uses the onmousemove event of javascript. The onmousemove event occurs when the mouse pointer
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