Home  >  Article  >  Web Front-end  >  Rewrite a simple menu with flexible size_navigation menu

Rewrite a simple menu with flexible size_navigation menu

WBOY
WBOYOriginal
2016-05-16 18:14:561001browse

A small explanation here is that it is about the function of dynamically setting the font size. Since the form of the 3D menu is not considered, I simply used the cosine function

. In the specific implementation, in order not to have two characters appear in the total height of the menu The peak of the wave creates an abrupt feeling. In fact, the K in cos(x/K) should be a function related to the number of menu items and the maximum font value. Here I simply set it to a constant.

The complete code is

Copy the code The code is as follows:



menu list









演示代码:http://demo.jb51.net/js/caidan/js_caidan.htm
Statement:
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