|File Size:||3.46 KB|
|Official Website:||Go to website|
automatic-direction is a jQuery plugin which automatically set the text direction of your text field to Right To Left based on Character Count (If Arabic or Persian characters are more than Latin characters it will be RTL . ).
How to use it:
automatic-direction.js along with the latest jQuery library into the webpage.
<script src="//code.jquery.com/jquery.min.js"></script> <script src="automatic-direction.js"></script>
2. Just add the CSS class 'dir-auto' to the
input elements and the plugin will do the rest.
<textarea class="dir-auto"></textarea> <input class="dir-auto">
3. The plugin also has the ability to Show the Arabic/Latin character count on front-end. Add the following HTML snippets to the webpage and we're done.
Arabic(or persian) characters: <span class="count-f"></span> Latin Characters: <span class="count-e"></span> All Characters: <span class="count-all"></span>
- Fixed: Count space as Latin characters