
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
foldcontent-zhihu
Advanced tools
用原生 js && jquery 实现知乎收起答案功能
具体实现可以看一下这篇文章 ٩(ˊᗜˋ*)و
src/ 目录下是原生 js 写法🌰
jquery/ 目录下是 jquery 写法🌰
main:
dist/foldcontent.min.js
dist/foldcontent_jquery.min.js
$ npm install foldcontent-zhihu@">=3.0.6" --save
<div class="foldcontent-panel">
<div class="part-content"><!--此处是部分内容--></div>
<div class="all-content"><!--此处是全部内容--></div>
</div>
<!-- ... -->
var foldcontent = require('foldcontent-zhihu');
var foldcontent_demo = new foldcontent({
'btnBg': '#eff6fa',
'btnColor': '#0c5897',
'fixBtnBg': '#81baeb',
'fixBtnColor': '#fff',
'fontSize': '12px',
'padding': '5px',
'initialText': '展开',
'fixText': '收起',
'bottom': '10px',
'right': '20px',
'lineHeight': '1'
});
<div class="foldcontent-panel">
<div class="part-content"><!--此处是部分内容--></div>
<div class="all-content"><!--此处是全部内容--></div>
</div>
<!-- ... -->
<script src="foldcontent.min.js"></script>
var foldcontent_demo = new foldcontent({
// ...
});
<div class="foldcontent-panel">
<div class="part-content"><!--此处是部分内容--></div>
<div class="all-content"><!--此处是全部内容--></div>
</div>
<!-- ... -->
<script src="../demo/js/01-jquery-1.11.3.min.js"></script>
<script src="foldcontent_jquery.min.js"></script>
$('.unfold').foldContentPlugin({
'btnBg': 'lightpink',
'btnColor': '#fff',
'paddingTop': '2px'
});
<div class="foldcontent-panel">
<div class="part-content"><!--此处是部分内容--></div>
<div class="all-content"><!--此处是全部内容--></div>
</div>
<!-- ... -->
<script src="../demo/js/01-jquery-1.11.3.min.js"></script>
<script src="foldcontent_jquery.min.js"></script>
require('foldcontent-zhihu');
$(function () {
$('.unfold').foldContentPlugin({
// ...
});
});
// webpack 全局加载 jquery 的一种方法
resolve: {
alias: {
jquery: path.resolve(js_path, 'lib/01-jquery-1.11.3.min.js')
}
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery' // 将jquery暴露给所有模块,不用显式require('jquery');只要模块的代码中出现了$,webpack就会自动将jQuery注入。
})
]
{
btnBg: '#eff6fa', // 按钮背景颜色
btnColor: '#0c5897', // 按钮字体颜色
fixBtnBg: '#81baeb', // 固定定位按钮背景颜色
fixBtnColor: '#fff', // 固定定位按钮字体颜色
fontSize: '12px', // 按钮字体大小
padding: '5px', // 按钮尺寸
initialText: '展开', // 按钮初始文本内容
fixText: '收起', // 固定定位按钮文本内容
bottom: '10px',
right: '20px', // 绝对定位
lineHeight: '1' // 按钮行高
};
$ npm install
$ npm start
MIT
FAQs
用原生 js 实现知乎收起答案功能
The npm package foldcontent-zhihu receives a total of 10 weekly downloads. As such, foldcontent-zhihu popularity was classified as not popular.
We found that foldcontent-zhihu 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.