
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
npm install sticky-ads
script tag
window.ygsticky.init();
amd
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.2/require.min.js"></script>
<script>
window.requirejs(['sticky-ads'], function(ygsticky) {
ygsticky.init();
});
</script>
函数 | 说明 | 参数 |
---|---|---|
init | 初始化组件 | (string: 'bottom','left') |
1、静态页面开发 可在public中本地调试 2、集成 src/index.js中为最终版本
3、本地测试:发版后,通过http://localhost:5000/example/example
吸底
// ygstick.init('bottom');
ygstick.init('bottom','http://mock.ygego.dev1/mock/5c19f7b22a5da1f110c2d2a0/ygbase/activity/sticky/bottom#!method=get',{expandImg: 'expandImg',collapseImg: 'collapseImg',jumpUrl: 'jumpUrl',title: 'title'})
吸左
// ygstick.init('left');
ygstick.init('left','http://mock.ygego.dev1/mock/5c19f7b22a5da1f110c2d2a0/ygbase/activity/sticky/left#!method=get',{expandImg: 'expandImg',collapseImg: 'collapseImg',jumpUrl: 'jumpUrl',title: 'title'})
项目集成
使用形式类似于 example/example
1、根据api接口不同,返回不同数据,options负责transformer 2、由页面调用方传入 api 真实的值 3、如果已保障 api 返回值,可不传入options options
结构定义:api 和 option 为可选项 init(type,[api,[option]])
{expandImg: 'expandImg字段名',collapseImg: 'collapseImg',jumpUrl: 'jumpUrl',title: 'title'}
public 做什么用
public 仅限于 不启动项目 本地自调试,需要执行将dom style js 迁移至src/index 中
源码
在 src/index.js中
源码入口:
init
dev 入口
example/app.js
与其他项目集成
example/example.html
测试集成效果
serve ./
# open http://localhost:5000/example/example.html
FAQs
yg sticky ads
We found that sticky-ads demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.