JSFiddle - React, Tailwind, and code Playground
by Omar X
HTML
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<div data-role="page">
<a data-role="button" data-icon="delete" data-iconpos="right" id="notext">Delete</a>
<a data-role="button" data-icon="home" data-iconpos="left">Home</a>
<p class="size"></p>
</div>
JavaScript
function resizeBtn() {
if ($(window).width() < 480) {
$("#notext").buttonMarkup({
iconpos: "notext"
});
} else {
$("#notext").buttonMarkup({
iconpos: "right"
});
}
/* for demo */
$(".size").html("Window's width: " + $(window).width());
}
$(document).on("pagebeforeshow", resizeBtn);
$(window).on("resize", resizeBtn);