PHPackages                             irice/w-scratch-pad - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. irice/w-scratch-pad

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

irice/w-scratch-pad
===================

v2.1.1(7y ago)0370MITJavaScript

Since Oct 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/iridance/wScratchPad)[ Packagist](https://packagist.org/packages/irice/w-scratch-pad)[ RSS](/packages/irice-w-scratch-pad/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

wScratchPad.js
==============

[](#wscratchpadjs)

A jQuery plugin to mimic a scratch card or pad behaviour. Allowing you to scratch off an overlay as either a color or image.

- [View the wScratchPad demo](http://wscratchpad.websanova.com)
- [Download the lastest version of wScratchPad](https://github.com/websanova/wScratchPad/tags)

Related Plugins
---------------

[](#related-plugins)

- [wPaint](http://wpaint.websanova.com) - Simple paint drawing plugin.
- [wColorPicker](http://wcolorpicker.websanova.com) - Color pallette seleciton plugin.

Settings
--------

[](#settings)

Available options with notes, the values here are the defaults.

```
$('#elem').wScratchPad({
  size        : 5,          // The size of the brush/scratch.
  bg          : '#cacaca',  // Background (image path or hex color).
  fg          : '#6699ff',  // Foreground (image path or hex color).
  realtime    : true,       // Calculates percentage in realitime.
  scratchDown : null,       // Set scratchDown callback.
  scratchUp   : null,       // Set scratchUp callback.
  scratchMove : null,       // Set scratcMove callback.
  cursor      : 'crosshair' // Set cursor.
});
```

Note on `realtime`, if set to `false` this will only send percentage calculations to the `scratchUp` and should be used to increase performance.

Note on `bg` and `fg`, these can be eitehr a valid hex color beginning with `#` otherwise it will default to trying to set an image.

Examples
--------

[](#examples)

Include the following files:

```

```

### Percent scratched

[](#percent-scratched)

```
$("#elem").wScratchPad({
  scratchDown: function(e, percent){ console.log(percent); },
  scratchMove: function(e, percent){ console.log(percent); },
  scratchUp: function(e, percent){ console.log(percent); }
});
```

### Update on the Fly

[](#update-on-the-fly)

```
var sp = $("#elem").wScratchPad();

sp.wScratchPad('size', 5);
sp.wScratchPad('cursor', 'url("./cursors/coin.png") 5 5, default');

// Or directly with element.

$("#elem").wScratchPad('image', './images/winner.png');
```

### Methods

[](#methods)

```
$('#elem').wScratchPad('reset');
$('#elem').wScratchPad('clear');
$('#elem').wScratchPad('enabled', );
```

Resources
---------

[](#resources)

- [More jQuery plugins by Websanova](http://websanova.com/plugins)
- [Websanova JavaScript Extensions Project](http://websanova.com/extensions)
- [jQuery Plugin Development Boilerplate](http://wboiler.websanova.com)
- [The Ultimate Guide to Writing jQuery Plugins](http://www.websanova.com/blog/jquery/the-ultimate-guide-to-writing-jquery-plugins)

License
-------

[](#license)

MIT licensed

Copyright (C) 2011-2012 Websanova

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2822d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/69b608dc39b26ddb292493c80af8b88985d1886073c06a6e25a269b33fb48a18?d=identicon)[iridance](/maintainers/iridance)

---

Top Contributors

[![websanova](https://avatars.githubusercontent.com/u/1645771?v=4)](https://github.com/websanova "websanova (48 commits)")[![iridance](https://avatars.githubusercontent.com/u/9459560?v=4)](https://github.com/iridance "iridance (4 commits)")[![grexican](https://avatars.githubusercontent.com/u/73737?v=4)](https://github.com/grexican "grexican (1 commits)")[![heysimonarnold](https://avatars.githubusercontent.com/u/1105060?v=4)](https://github.com/heysimonarnold "heysimonarnold (1 commits)")[![KernCheh](https://avatars.githubusercontent.com/u/7960103?v=4)](https://github.com/KernCheh "KernCheh (1 commits)")[![RichardVanDerMeer](https://avatars.githubusercontent.com/u/1893578?v=4)](https://github.com/RichardVanDerMeer "RichardVanDerMeer (1 commits)")

### Embed Badge

![Health badge](/badges/irice-w-scratch-pad/health.svg)

```
[![Health](https://phpackages.com/badges/irice-w-scratch-pad/health.svg)](https://phpackages.com/packages/irice-w-scratch-pad)
```

###  Alternatives

[fedemotta/yii2-widget-datatables

DataTables widget for Yii2

34182.9k1](/packages/fedemotta-yii2-widget-datatables)[bacularis/bacularis-app

Bacularis - The Bacula web interface

254.4k](/packages/bacularis-bacularis-app)[bacularis/bacularis-web

Web files for Bacularis - The Bacula web interface

103.9k6](/packages/bacularis-bacularis-web)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
