Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
sticky-sidebar
Advanced tools
Pure JavaScript plugin for making smart and high performance sticky sidebars.
See for complete documentation and examples abouolia.github.com/sticky-sidebar
You can download sticky sidebar jquery plugin from Bowser, NPM or just simply download it from here than put sticky-sidebar.js
file in your project folder.
If you are using bower as package manager:
bower install sticky-sidebar
If you are using NPM as package manager:
npm install sticky-sidebar
Your website's html structure has to be similer to this in order to work:
<div class="main-content">
<div class="sidebar">
<div class="sidebar__inner">
<!-- Content goes here -->
</div>
</div>
<div class="content">
<!-- Content goes here -->
</div>
</div>
Note that inner sidebar wrapper .sidebar__innner
is optional but highly recommended, if you don't write it yourself, the script will create one for you under class name inner-wrapper-sticky
. but this may cause many problems.
For the above example, you can use the following JavaScript:
<script type="text/javascript" src="./js/sticky-sidebar.js"></script>
<script type="text/javascript">
var sidebar = new StickySidebar('.sidebar', {
topSpacing: 20,
bottomSpacing: 20,
containerSelector: '.main-content',
innerWrapperSelector: '.sidebar__inner'
});
</script>
You can configure sticky sidebar as a jQuery plugin, just include jquery.sticky-sidebar.js
instead sticky-sidebar.js
file than configure it as any jQuery plugin.
<script type="text/javascript" src="./js/jquery.js"></script>
<script type="text/javascript" src="./js/jquery.sticky-sidebar.js"></script>
<script type="text/javascript">
$('#sidebar').stickySidebar({
topSpacing: 60,
bottomSpacing: 60
});
</script>
Make sure to include sticky-sidebar.js
script file after jquery.js
.
Sticky sidebar integrated with ResizeSensor.js to detect when sidebar or container is changed. To use resize sensor with this plugin just make sure to include ResizeSensor.js before sticky-sidebar.js
code whether through module loader, bundle or event inclusion as a <script>
and enable resizeSensor
option (enabled by default) and it will works.
You can choose not to include ResizeSensor.js
and sticky sidebar will continue work without any problem but without automatically detect resize changes.
Sticky sidebar works in all modern browsers including Internet Explorer 9 and above, but if you want it to work with IE9, should include requestAnimationFrame
polyfill before sticky sidebar code.
If you have any issue with browser compatibility don’t hesitate to Submit an issue.
Sticky Sidebar is released under the MIT license. Have at it.
Made by Ahmed Bouhuolia
FAQs
A JavaScript plugin for making smart and high performance.
We found that sticky-sidebar 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.