
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Simple "zooming lightbox" that doesn't suck.
This is a fairly simple piece of JS code, but also something I've re-written a number of times over the last few years. So here's the "canonical version".
Include the JavaScript code. For Ruby on Rails, you can use the gem (see below).
All you need to do after that is tell it which images to zoom:
$('img').picture_zoomer()
The larger version is loaded either from the data-large
or src
attribute:
<img src="smaller_version.jpg" data-large="larger-version.jpg">
<img src="large_version.jpg" style="width: 100px">
or if you also want your image to do something without JS:
<a href="larger-version.jpg">
<img src="smaller_version.jpg" data-large="larger-version.jpg">
</a>
There's one (optional) argument: the animation speed. The default is 400ms.
// Very fast!
$('img').picture_zoomer(100)
// Just show a large version (don't animate)
$('img').picture_zoomer(0)
That's all there's to it :-)
This is packaged as a Ruby gem ready to use in a Rails app.
Add to your Gemfile
gem 'picture_zoomer'
Add to your application.js
:
// =require picture_zoomer
FAQs
Unknown package
We found that picture_zoomer 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
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.