Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
SweeTango
Pacific Rose
SnapDragon
Envy
Koru (Plumac)
Pink Lady (Cripps Pink)
Honeycrisp
Royal Gala
Macoun
McIntosh
Autumn Glory
Opal
Rome
Red Delicious
Golden Delicious
Cameo
Granny Smith
Rainier Gala
SweeTango
Pacific Rose
SnapDragon
Envy
Koru (Plumac)
Pink Lady (Cripps Pink)
Honeycrisp
Royal Gala
Macoun
McIntosh
Autumn Glory
Opal
Rome
Red Delicious
Golden Delicious
Cameo
Granny Smith
Rainier Gala
SweeTango
Pacific Rose
SnapDragon
Envy
Koru (Plumac)
Pink Lady (Cripps Pink)
Honeycrisp
Royal Gala
Macoun
McIntosh
Autumn Glory
Opal
Rome
Red Delicious
Golden Delicious
Cameo
Granny Smith
Rainier Gala
SweeTango
Pacific Rose
SnapDragon
Envy
Koru (Plumac)
Pink Lady (Cripps Pink)
Honeycrisp
Royal Gala
Macoun
McIntosh
Autumn Glory
Opal
Rome
Red Delicious
Golden Delicious
Cameo
Granny Smith
Rainier Gala
css
:root { --width: 494px; --height: 242px; --chrome: 22.5px; --outer-border-radius: 25px; --thumb-radius: 0px; } html { box-sizing: border-box; } * { box-sizing: inherit; } body { min-height: 100vh; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; background: -webkit-radial-gradient(turquoise, midnightblue); background: radial-gradient(turquoise, midnightblue); font-weight: lighter; font-size: 10px; } .outer { position: relative; margin: 0 auto; width: var(--width); height: var(--height); border-radius: var(--outer-border-radius); border: solid 2px buttonface; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; background: black; } .inner { background: white; /* position: absolute; */ margin: 0 auto; width: calc(100% - var(--chrome)); height: calc(100% - var(--chrome)); border-radius: calc(var(--chrome) - 10px); overflow-y: scroll; overflow-x: hidden; } .notch { position: absolute; background: black; width: 3%; height: 60%; top: 20%; left:calc(var(--chrome)/2); border-radius: 0 10px 10px 0; } ul { padding-left: calc(var(--chrome)/4); padding-right: 10px; margin: 5px 0; overflow: hidden; } li { list-style: none; padding: 5px 5px; border-bottom: 1px solid #dadada; -webkit-transform-origin: center left; transform-origin: center left; } *::-webkit-scrollbar { width: 5px; padding: 100px; -webkit-transform: scalex(10); transform: scalex(10); } *::-webkit-scrollbar-thumb { border-radius: var(--thumb-radius); background-color: #5555; padding-right: 5px; -webkit-transform: scalex(10); transform: scalex(10); }
JavaScript
console.clear(); const THRESH = 10; const $ = selector => document.querySelector(selector); const $$ = selector => document.querySelectorAll(selector); const items = $$("li"); const style = getComputedStyle(document.body); // const chromeWidth = style.getPropertyValue("--chrome"); const chromeWidth = 22.5; const setCustomProperty = (property, value) => { style.setProperty("--${property}", value); }; let notchRect = $(".notch").getBoundingClientRect(); window.addEventListener("resize", () => { notchRect = $(".notch").getBoundingClientRect(); }); bumpItems(); $(".inner").onscroll = onScroll; function onScroll(e) { window.requestAnimationFrame(bumpItems); } function bumpItems() { for (let item of items) { const itemRect = item.getBoundingClientRect(); const distFromBottom = itemRect.top - notchRect.bottom; const distFromTop = itemRect.bottom - notchRect.top; if (Math.abs(distFromTop) < THRESH) { item.style.transform = `translateX(${lerp( 0, chromeWidth, (distFromTop + THRESH) / (THRESH * 2) )}px)`; } else if ( distFromTop > 0 && Math.abs(distFromBottom) > THRESH && distFromBottom < 0 ) { item.style.transform = `translateX(${chromeWidth}px)`; } else if (Math.abs(distFromBottom) < THRESH) { item.style.transform = `translateX(${lerp( chromeWidth, 0, (distFromBottom + THRESH) / (THRESH * 2) )}px)`; } else { item.style.transform = `translateX(0)`; } } } function lerp(v0, v1, t) { return v0 * (1 - t) + v1 * t; }
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>iPhone 缺口滚动2-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号