Git Product home page Git Product logo

deawx / jquery-fancy-letter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from craigerskine/jquery-fancy-letter

0.0 1.0 0.0 13 KB

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.

Home Page: https://craigerskine.github.io/jquery-fancy-letter/

License: The Unlicense

JavaScript 21.61% HTML 78.39%

jquery-fancy-letter's Introduction

jquery.fancyletter.js

Requires jQuery.

Usage

$(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

<p class="blah">Chicken</p>
<p class="blah">Foo</p>
<p class="blah">Bar</p>

<script>
  $('.blah').fancyletter();
</script>

Result

<p class="blah">
  <span class="ltr ltr-c">C</span>hicken
</p>
<p class="blah">
  <span class="ltr ltr-f">F</span>oo
</p>
<p class="blah">
  <span class="ltr ltr-b">B</span>ar
</p>

jquery-fancy-letter's People

Contributors

craigerskine avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.