简体   繁体   中英

Transparent-gradient menu

I have a complex problem. I want to create a menu. At the same time just only 3 elements are visible, and 2 other, which are transparent-gradient. If I move the cursor in a transparent element, the list will scroll up or down. The menu menu have sub-levels, which have the same format as the main level.

Here is a sample: 在此处输入图片说明

When it stop, it's okay. The first, and last displaying element's CSS set linear-gradient. When it move, i use jquery to animate the moving. But the result is not exactly I want. When it scroll, it looks like the whole list is moving, not scrolling. I want to use jQuery just the move animation, and the transparent gradient set the whole list, not for the list element.

I guess I should use mask for the list, but the background is transparent too. I run out from ideas.

I solve it. I use "overflow:hidden" and svg mask. The sub-level is an other ul list, not include in the first level, and jquery set the display.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM