I'm very new to Jquery & jquery mobile. I'm resizing a button so it's responsive to window size. To be more specific, i'm changing it from iconpos="left" to iconpos="notext" to remove the text on small windows. I found the following function, which works for me.
$(window).on("throttledresize", function() {
var smallButtons = $(window).width() <= 480;
$('#menu_toggle').toggleClass('ui-btn-icon-notext', smallButtons);
$('#menu_toggle').toggleClass('ui-btn-icon-left', !smallButtons);
});
But it only works on the window resizing. Obviously, I'd also like it showing the correct size on pageload, not just resizing. I found the code below, but I don't know how put them both into 1, more succinct bit of code.
$("#page_id").on("pageshow" , function() {
The Function
});