Tagged: x
-
AuthorPosts
-
September 28, 2016 at 11:58 am #1194234
Chris StovallParticipantFor quite some time now, I’ve been using this method for creating responsive text and it’s been working great.
jQuery ( function($) { $(".three-box").csFitText(.88, { minFontSize: '24px', maxFontSize: '54px' }); $(".h-resp-small").csFitText(.90, { minFontSize: '18px', maxFontSize: '22px' }); $(".h-resp-med").csFitText(.90, { minFontSize: '28px', maxFontSize: '36px' }); $(".h-resp-large").csFitText(.90, { minFontSize: '28px', maxFontSize: '38px' }); $(".h-resp-max").csFitText(.90, { minFontSize: '48px', maxFontSize: '82px' }); $(".main-header").csFitText(.80, { minFontSize: '', maxFontSize: '' }); });I would like to find a way where I don’t need to hardcode the font sizes. It’s very time consuming.
My questions are this:
1) Can I use percentages in this code?
2) Could I have it only affect the compression of the text?
3) I’ve also read this thread which seems like a solid solution, but it’s not working at all.
https://community.theme.co/forums/topic/title-texth1-not-resizing-in-responsive-view/
Thanks in advance!
CDSSeptember 28, 2016 at 1:22 pm #1194375
RupokMemberHi there,
It seems you are trying to achieve something that’s not the features by Responsive Text. You need to use the Responsive Text feature as is and it’s not possible to extend the features or functionality of it.
Thanks!
September 29, 2016 at 11:09 am #1195939
Chris StovallParticipantAs you can see above, this code was provided by X theme to make the responsive text work on each page. It would be completely silly to assume one would have to create a new responsive text on each page for the same application.
The question is can I use just the compression or set the text to a percentage rather than a set size?
September 29, 2016 at 12:21 pm #1196028
RupokMemberHi there,
Thanks for writing back. Unfortunately there is no way to define responsive text globally and apply to all pages. We already have some feature request for this and hopefully will be implemented in future.
Thanks for understanding.
September 30, 2016 at 11:56 am #1197521
Chris StovallParticipantI’ve been using this method for years now.
jQuery ( function($) { $(".three-box").csFitText(.88, { minFontSize: '24px', maxFontSize: '54px' }); $(".h-resp-small").csFitText(.90, { minFontSize: '18px', maxFontSize: '22px' }); $(".h-resp-med").csFitText(.90, { minFontSize: '28px', maxFontSize: '36px' }); $(".h-resp-large").csFitText(.90, { minFontSize: '28px', maxFontSize: '38px' }); $(".h-resp-max").csFitText(.90, { minFontSize: '48px', maxFontSize: '82px' }); $(".main-header").csFitText(.80, { minFontSize: '', maxFontSize: '' }); });The only question is can I use a font size percentage or only affect the compression?
I feel like you’re not really reading my question at all.
September 30, 2016 at 7:18 pm #1197916
JadeModeratorHi Chris,
Yes, you can use % values in the JS code. It should work find but it will automatically be calculated into pixel values when you view it in the frontend.
October 1, 2016 at 9:48 am #1198531
Chris StovallParticipantCan you please provide an example of an updated code that would work? I tried and didn’t get a great result. The reason this is diffucult is becuase all of the x theme fonr sizes are percentages.
jQuery ( function($) { $(".r-header").csFitText(.88, { minFontSize: '100%', maxFontSize: '200%' }); });Can you please test this and let me know if it’s working on your end?
Thanks!
October 1, 2016 at 7:29 pm #1198867
RadModeratorHi there,
I think that may not work. It’s like a loop, it will get the percentage from the original font size.
If the base size is 30px and it changed to 200% then it will become 60px. Now, it will resize down to 100%, and 100% of 60px is 60px. Base sizes are those with fixed value like pixels.
Thanks.
October 3, 2016 at 5:23 pm #1201113
Chris StovallParticipantThis reply has been marked as private.October 4, 2016 at 1:51 am #1201565
LelyModeratorHi Chris,
Unfortunately, at this time I am not sure about your question. Would you mind clarifying so we can help you better?
October 6, 2016 at 10:31 am #1205186
Chris StovallParticipantGiving up on this thread now. I’ve asked the same question several different ways and I can’t seem to get an answer.
Thanks for trying!
= )
CDS
October 6, 2016 at 10:52 am #1205222
RahulModeratorYou’re most welcome!
Let us know if you have any further queries with the theme. We’d be happy to assist you with it.
Thank you.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1194234 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
