<textarea> demo for jQuery URLive
See the plugin repo at GitHub: https://github.com/markserbol/urlive
! Github is not a CDN, download the files for your project.
HTML
<script src="http://markserbol.github.io/urlive/jquery.urlive.js"></script>
<link rel="stylesheet" href="http://markserbol.github.io/urlive/jquery.urlive.css">
<textarea placeholder="input a URL here">
http://markserbol.github.io/flip-quote/
</textarea>
<div class="urlive-container">
<span class="loading">Loading...</span>
</div>
CSS
body {
font-family:'Segoe UI', 'Open Sans', sans-serif;
max-width:420px;
}
textarea {
height:70px;
width:100%;
}
.urlive-container {
margin-top:15px;
padding:0 0 50px 0;
}
.loading {
display:none;
}
JavaScript
$('textarea').on('input propertychange', function () {
$('textarea').urlive({
callbacks: {
onStart: function () {
$('.loading').show();
$('.urlive-container').urlive('remove');
},
onSuccess: function (data) {
$('.loading').hide();
$('.urlive-container').urlive('remove');
},
noData: function () {
$('.loading').hide();
$('.urlive-container').urlive('remove');
}
}
});
}).trigger('input');