triggerjs / trigger Goto Github PK
View Code? Open in Web Editor NEWA library for creating scroll-based animation with HTML attributes and CSS variables.
License: MIT License
A library for creating scroll-based animation with HTML attributes and CSS variables.
License: MIT License
滚动监听目前好像仅支持body,如果需要自定义的话需要自己改源码,可不可以支持自定义节点监听滚动?
tg-map能接收一个内容类似函数(参数可以是现在第几步)的字符串用来随机返回一些东西(比如色值)吗
Line 5 in 3831e95
before
和 after
都未从 hook
中拿出来,这行结果永远都是 false
过来给个star
你好,我在一个vue项目中的页面A引入后(引入方法为import '@triggerjs/trigger/dist/bundle') ;之后我从页面A路由跳转到页面B,之后再从页面B路由跳转到页面A时,该JS库失效,请问该如何解决?
I remember unpkg
CDN has a slow speed in the Chinese mainland. So I'd like to suggest also mentioning using the jsDelivr CDN in the guide. Besides the speed, it also supports fetching any public files from the GitHub repository. For example, we can get the latest built files from the default main branch through https://cdn.jsdelivr.net/gh/triggerjs/trigger/dist/bundle.js
Here is the package in the jsDelivr CDN: https://www.jsdelivr.com/package/npm/@triggerjs/trigger
您好,问一下,tg-ref与tg-follow能不能适用于一个子级元素绑定到父级元素的兄弟级元素?
这个功能有个问题,如果filter和map指定刚好重复的话会返回异常的值
例子
<div
class="lift-transition-sticky-content"
tg-from="0"
tg-to="100"
tg-edge="cover"
tg-name="position"
tg-filter="0,50,100@"
tg-map="0:50;50:0;100:0"
></div>
在50-100
的值为0
,但是最终渲染的会是50
,因为map也指定了0
的映射值
源码问题在这
export function parseValues() {
if (filter.values.length > 0 && !filter.values.includes(value)) {
if (filter.mode === 'smooth') {
let region = calcKeyFrameRegion(mapping, value);
if (region.length) {
// 这里获取的范围值是 0
value = calcKeyFrameValue(mapping, value, region);
} else {
return;
}
} else {
if (filter.mode === 'exact') {
element.lastValue = null;
el.style.removeProperty(name);
}
return;
}
}
// 这里会根据value的值重新获取映射导致异常
if (typeof mapping[value] !== 'undefined') {
value = mapping[value];
}
}
Originally posted by @RexYao97 in #28 (comment)
Really amazing work!!
Hoping for a demo website for an easy and quick overview and demonstration.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.