It can be applied to a wide range of applications, especially websites using standard architecture, such as Just say pjblog. With a simple click, the website can change its skin in an instant. Of course, it can be achieved through other methods. Here it is implemented through jquery. The advantage is that the code is simple and readable Put the code first
The function of this function is to select the current style $('link[@rel*=style][@title]').each(function(i) With the previous knowledge, this sentence It should not be difficult to understand, that is, all tags are named link, contain the rel attribute, and the rel attribute must contain style, and there must also be an object with the title attribute, each of which executes the corresponding function
These are the codes that change the style part after clicking. We noticed that there are rel attributes and class attributes, which are convenient for positioning. Example: http://www.healdream.com/upLoad/html/jquery/styleswitch/
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn