Rewrite a simple menu elastic size _ navigation menu

Source: Internet
Author: User
I can see a simple menu style. Because it was a relatively early work of the author, the visual effect was not very good and a little abrupt and I made some slight changes myself, imitating the icon animation effect (the key difference is that getStyle gets the current calculated style function) Here is a small description about the function for dynamically setting the font size, because I did not consider the 3D menu format, I simply used the cosine function.

To avoid two peaks in the overall menu height, cos (x/K) K In should be a function related to the number of menu entries and the maximum font value. Here I set it as a constant.

The complete code is

The Code is as follows:




Menu list

Related Article

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.