Closed replete closed 10 years ago
A resize.fittext
event was added in 57ce345437f9b1871ece163a15954595a6e02b1e This probably solves the functionality of your use case. Thanks for you commit.
@federicovezzoli You can disable fittext with:
$('.myelems').off('resize.fittext orientationchange.fittext');
hey @davatron5000 thanks for the tip. But If I remove the handler on the element is not working, it works if I remove it from the window element. so, it works only with:
$(window).off('resize.fittext orientationchange.fittext');
Is there any way to disable it only on some selectors, like in the example you gave?
Hmm... sounds like you're trying to use window.resize
to trigger a window.resize
. In that case, I'd probably go a different route and hijack fittext's resize instead.
$(window).on('resize.fittext', function(){
var mediaQuery = '(max-width: 480px)';
if(window.matchMedia(mediaQuery).matches) {
$('h1.fixedFontSizeOnMobile').css('font-size', '36px');
}
});
Anyways, this is personal support stuff for your specific implementation and not relevant to bugs, issues, or functionality to this plugin. I recommend asking your questions over on StackOverflow. Thanks.
Sorry than.
Sorry, I do not understand how to call the off event to disable fittext. Anyone can help me?