Using JS to make 163 landing page Ultimate Version (written for one night)

Source: Internet
Author: User

Using JS to make 163 landing Page Ultimate Version (write a night), some features are not perfect, interested can go to their own to achieve some functions, basically all the functions I have realized, only a few did not realize, there are some regular expression of the use, mainly or table design, not with Div, Next time you upload a div.

Look at the HTML code below:

<!    DOCTYPE html>
Here is the JS code:

/** * * @param idorname If the incoming ID is preceded by # if the incoming name is passed directly into the * @returns {*} returns the element node if not found returns null */function $ (idorname) {VA    R Obj=null;        if (idorname) {if (Idorname.charat (0) = = "#") {Obj=document.getelementbyid (idorname.substring (1));        }else{Obj=document.getelementsbyname (idorname); }} return obj; /** * * @param parentnode parent node * @returns {Array} all element child nodes */function Getchildnodes (parentnode) {var childs=parentnode    . childNodes;    var newchilds=[];        for (Var i=0;i<childs.length;i++) {if (childs[i].nodetype==1) {Newchilds.push (childs[i]); }} return newchilds;} /** * * @param parentnode parent node * @returns {*|    node} The first element nodes */function Getfirstchild (parentnode) {var firstchild=parentnode.firstchild;    if (firstchild.nodetype==3) {firstchild=firstchild.nextsibling; } return firstchild;} /** * * @param parentnode parent node * @returns {*| Node} last element */function Getlastchild (parentnode) {var LastchiLd=parentnode.lastchild;    if (lastchild.nodetype==3) {lastchild=lastchild.previoussibling; } return lastchild;} /** * * @param node ELEMENT nodes * @returns {*|    Node} returns the next sibling element */function getnextsibling (node) {var nextnode=node.nextsibling;    if (nextnode.nodetype==3) {nextnode=nextnode.nextsibling; } return nextnode;} /** * * @param node ELEMENT nodes * @returns {*|    Node} returns the previous sibling element nodes */function getprevioussibling (node) {var prenode=node.previoussibling;    if (prenode.nodetype==3) {prenode=prenode.previoussibling; } return Prenode;}


The interface achieves the following effects:




Using JS to make 163 landing page Ultimate Version (written for one night)

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.