lax实现滚定拼图效果代码
代码语言:html
所属分类:加载滚动
代码描述:lax实现滚定拼图效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> .piece { background: #30908a; border-radius: 6px; margin: 3px; box-shadow: 0px 2px 4px 0px #ddd; display: flex; align-items: center; justify-content: center; } .piece span { font-size: 36px; font-family: monospace; color: #fff; } .empty { background: none; box-shadow: none; } .grid { display: grid; grid-template-columns: 1fr 1fr 1fr; width: 300px; height: 300px; position: sticky; top: 50%; transform: translateY(-50%); margin: 0 auto; background: #fff; border-radius: 12px; padding: 8px; box-shadow: 0px 2px 4px 0px #65cfa6; } .container { position: relative; height: 12000px; } body { background: #35f4a6; } </style> </head> <body > <div class="container"> <div class="grid"> <div class="piece piece-1 empty"></div> <div class="piece piece-2"><span>2</span></div> <div class="piece piece-3"><span>8</span></div> <div class="piece piece-4"><span>4</span></div> <div class="piece piece-5"><span>7</span></div> <div class="piece piece-6"><span>1</span></div> <div class="piece piece-7"><span>6</span></div> <div class="piece piece-8"><span>5</span></div> <div class="piece piece-9"><span>3</span></div> </div> </div> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/lax.js&.........完整代码请登录后点击上方下载按钮下载查看
网友评论0