gsap实现横向拖拽图片相册效果代码
代码语言:html
所属分类:拖放
代码描述:gsap实现横向拖拽图片相册效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> * { box-sizing: border-box; } body { height: 100vh; overflow: hidden; background: #000; color: #fff; font-family: "Playfair Display", cursive; display: flex; align-items: center; justify-content: center; } .menu { overflow: hidden; cursor: -webkit-grab; cursor: grab; width: 100%; position: relative; z-index: 1; height: 40vh; } .menu.is-dragging { cursor: -webkit-grabbing; cursor: grabbing; } .menu--wrapper { counter-reset: count; display: flex; position: absolute; z-index: 1; height: 100%; top: 0; left: 0; width: 100%; } .menu--item { counter-increment: count; position: absolute; z-index: 1; top: 0; left: 0; width: 30vw; height: 100%; padding: 0 1.5vw; overflow: hidden; } @media (max-width: 767px) { .menu--item { width: 40vw; height: 40vw; } } .menu--item:nth-child(n+10):before { content: counter(count); } .menu--item fig.........完整代码请登录后点击上方下载按钮下载查看
网友评论0