This time I will share jQuery Plugin and tutorial about jQuery Plugin For Turning Plain URLs Into Links – linkItUp, hope it will help you in programming stack.
linkItUp is an ultra light (~1kb) jQuery plugin that finds raw URLs in a specified container and converts them into clickable a
links. In addition, you can add custom CSS classes or styles to the a
tag.
How to use it:
1. Put jQuery library and the jQuery linkItUp plugin at the end of the document so the pages load faster.
1 |
< script src = "//code.jquery.com/jquery-1.12.1.min.js" ></ script > |
2 |
< script src = "src/linkItUp.js" ></ script > |
2. Call the linkItUp()
function on the container that contains URLS in text format.
1 |
$( '.container' ).linkItUp(); |
3. Open the links in new windows.
1 |
$( '.container' ).linkItUp({new_tab: true }); |
4. Add additional CSS classes to the links.
1 |
$( '.container' ).linkItUp({ |
2 |
class: 'some-class and-other-class' , |
5. Apply custom CSS classes to the links.
1 |
$( '.container' ).linkItUp({ |
2 |
style: 'background-color: #EF476F;' |
6. Specify the link rel
attribute.
1 |
$( '.container' ).linkItUp({ |
7. Make all the links have the same ‘title’ attribute.
1 |
$( '.container' ).linkItUp({ |
This awesome jQuery plugin is developed by toddnestor. For more Advanced Usages, please check the demo page or visit the official website.