Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/craigerskine/jquery-fancy-letter

jQuery plugin to wrap the first letter of an element in a class that contains that letter's character. Basically a more powerful :first-letter option.
https://github.com/craigerskine/jquery-fancy-letter

jquery jquery-plugin

Last synced: 13 days ago
JSON representation

jQuery plugin to wrap the first letter of an element in a class that contains that letter's character. Basically a more powerful :first-letter option.

Awesome Lists containing this project

README

        

# jquery.fancyletter.js

Requires jQuery.

### Usage

```code
$(selector).fancyletter();
```

selector = your element you'd like to manipulate

### Options
```
{
// base class of character
commonClass: 'ltr',

// prefix class of character - actual lowercase character will get appended to this string
prefixClass: 'ltr-',

// if you want to match things other than letters, you better be good at regex
characters: '[a-zA-Z]'
}
```

### Example

```html

Chicken


Foo


Bar

$('.blah').fancyletter();

```

### Result

```html


Chicken



Foo



Bar


```