
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.
@sygnas/tabs
Advanced tools
カスタマイズ可能なタブナビゲーションを実装。
シンプルなタブナビゲーションを使いたい人向け。
タブナビゲーションのスクリプトという名目ですが、data属性を与えるだけでコンテンツ制御を何もしません。 その代わり CSS で好きなように見た目をカスタマイズできます。
注意:IEで使う場合は polyfill が必要です。
npm install --save @sygnas/tabs
<!-- <a href="#{番号}"> でコンテンツ番号を指定-->
<!-- data-tabs-content="{コンテンツのセレクタ}" -->
<ul class="js-tabs" data-tabs-content=".js-tabs-content">
<li><a href="#0">PROFILE</a></li>
<li><a href="#1">DISCOGRAPHY</a></li>
</ul>
<!-- 配置順がそのままコンテンツ番号になる -->
<div class="js-tabs_content">コンテンツ 0</div>
<div class="js-tabs_content">コンテンツ 1</div>
.js-tabs{
// タブボタン
a{
// アクティブ状態
&[data-tabs-active = "true"]{
background-color: #ccc;
}
}
}
// 表示切り替えコンテンツ
.js-tab-content{
display: none;
// アクティブ状態
&[data-tabs-active = "true"]{
display: block;
}
}
import Tabs from '@sygnas/tabs';
const tab = new Tabs('.js-tabs');
data属性 | 初期値 | 説明 |
---|---|---|
data-tabs-content | 切り替え対象コンテンツのセレクタ | |
data-tabs-prev | 戻るボタンのセレクタ | |
data-tabs-next | 進むボタンのセレクタ | |
data-tabs-initial | 0 | 初期状態で表示するページ番号 |
data-tabs-hash | URLハッシュに対応するなら "true"。 Options より優先される |
const tab = new Tabs('.js-tabs', {
tab_selector: 'button',
use_url_hash: true
});
項目 | 初期値 | 説明 |
---|---|---|
tab_selector | 'a' | タブボタンのセレクタ。<button> を使いたい時などに変更 |
use_url_hash | false | タブ状態をURLに反映したり、URLから初期表示ページを設定出来るようにする |
MIT
FAQs
Simple tab script. シンプルなタブ
The npm package @sygnas/tabs receives a total of 1 weekly downloads. As such, @sygnas/tabs popularity was classified as not popular.
We found that @sygnas/tabs 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.