A jQuery plugin that creates stripes on an img element.
Requires <canvas>
so no IE8.
Download the production version or the development version.
In your web page:
<img id="stripes" style="background:#888"/>
<script>
$('#stripes').stripes({
lineWidth: 10,
separation: 10,
angle: 45, // degrees
degrees: true, // false for radians
foregroundColor: "#000", // takes any css color;
backgroundColor: null //transparent by default
});
</script>
http://jsfiddle.net/gunderson/xdaYB/1/
or get stripes as a dataURL image:
<script>
var myStripes = $.stripes({
lineWidth: 10,
separation: 10,
angle: 45, // degrees
degrees: true, // false for radians
foregroundColor: "#000", // takes any css color;
backgroundColor: null //transparent by default
});
$("#stripes").attr("src", myStripes)
</script>