Home > Web Front-end > JS Tutorial > Stay away from JS disaster and CSS disaster: js private functions and css selectors as containers_jquery

Stay away from JS disaster and CSS disaster: js private functions and css selectors as containers_jquery

WBOY
Release: 2016-05-16 17:58:33
Original
1207 people have browsed it

Although js can construct objects and hide private methods like an object-oriented one, when the needs often change faster than you can write a program, there is no time to even design js objects, so I prefer to use js private functions and js method; jquery private function and jquery externally exposed method can also be implemented, and the html structure generated by the page is completely generated in js, including which ids and classes, so as to ensure the convenience of unification and reuse to the greatest extent, but There is also a disadvantage, that is, when reusing, if the style needs to change (the structure is fixed and cannot be changed), the original structure needs to be wrapped with div, and the relevant styles also need to be wrapped with the corresponding id. If it is a new Events, etc. can only be bound by binding, and there is currently no good method.
For example, I want to include several pictures in a div
There is also a disadvantage in doing so. Only the css must be copied once. Making modifications but reusing the structure, style and js

Copy the code The code is as follows:





Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template