Skip to content

Instantly share code, notes, and snippets.

@andreascarpello
Created March 23, 2015 08:46
Show Gist options
  • Save andreascarpello/0ebad3ea39d70f3fe200 to your computer and use it in GitHub Desktop.
Save andreascarpello/0ebad3ea39d70f3fe200 to your computer and use it in GitHub Desktop.
Dottify plugin, Add dotted pattern to div element
/**
* Add dotted pattern to div element
* usage: $('div').dottify();
*/
$.fn.dottify = function() {
var container = this.parent();
this.css('position', 'relative');
var dottedBG = $('<div/>', {
'class': 'dotted-bg',
});
dottedBG.appendTo(this);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment