Comments (5)
Interestingly if I comment out the following 4 lines it seems to work fine:
if(newFontSize + j*intervals[m] > maxFontSize) {
newFontSize = maxFontSize;
break outer;
}
Can anyone tell me what problems removing that code is likely to cause?
from bigtext.
Can you try again with 0.1.8? I changed some of the resize logic.
from bigtext.
I'm using 0.1.8 and I am having the same issue. Commenting out the same 4 lines that skmbr mentioned above fixed the issue for me.
from bigtext.
Confirm, commenting those lines fixed the issue.
from bigtext.
I can confirm. I added some logging by moving this console.log
up a line so it's always run: https://github.com/zachleat/BigText/blob/master/src/bigtext.js#L139. And adding logging form
and j
in the 2 loops. Here's a broken run (using maxFontSize: 98
and keeping those lines uncommented). My maxwidth is 560.
409 " previous: 0" "font-size at 8" "prior: 59" "new:67"
m 0 j 2
457 " previous: 409" "font-size at 8" "prior: 67" "new:75"
m 0 j 3
506 " previous: 457" "font-size at 8" "prior: 75" "new:83"
m 0 j 4
555 " previous: 506" "font-size at 8" "prior: 83" "new:91"
m 0 j 5
599 " previous: 0" "word-spacing at 1" "prior: 0" "new:1"
Here's another run commenting those lines out but keeping maxFontSize: 98
m 0 j 1
409 " previous: 0" "font-size at 8" "prior: 59" "new:67"
m 0 j 2
457 " previous: 409" "font-size at 8" "prior: 67" "new:75"
m 0 j 3
506 " previous: 457" "font-size at 8" "prior: 75" "new:83"
m 0 j 4
555 " previous: 506" "font-size at 8" "prior: 83" "new:91"
m 0 j 5
604 " previous: 555" "font-size at 8" "prior: 91" "new:99"
m 1 j 1
579 " previous: 0" "font-size at 4" "prior: 91" "new:95"
m 2 j 1
561 " previous: 0" "font-size at 1" "prior: 91" "new:92"
m 3 j 1
555 " previous: 0" "font-size at 0.1" "prior: 91" "new:91.1"
m 3 j 2
556 " previous: 555" "font-size at 0.1" "prior: 91.10000000000001" "new:91.2"
m 3 j 3
557 " previous: 556" "font-size at 0.1" "prior: 91.2" "new:91.3"
m 3 j 4
557 " previous: 557" "font-size at 0.1" "prior: 91.30000000000001" "new:91.4"
m 3 j 5
558 " previous: 557" "font-size at 0.1" "prior: 91.4" "new:91.5"
m 3 j 6
559 " previous: 558" "font-size at 0.1" "prior: 91.5" "new:91.6"
m 3 j 7
559 " previous: 559" "font-size at 0.1" "prior: 91.60000000000001" "new:91.7"
m 3 j 8
560 " previous: 559" "font-size at 0.1" "prior: 91.7" "new:91.8"
560 " previous: 0" "word-spacing at 1" "prior: 0" "new:1"
Notice in the working case it tries 99, and then resizes back down. My maxwidth is 560px.
from bigtext.
Related Issues (20)
- Does BigText work with <a href> links? HOT 1
- Not working with textarea HOT 1
- BigText taking ~5sec to apply after full site loads, Wordpress HOT 2
- BigText does not care about div height to set font-size
- Uncaught TypeError: Cannot read property 'BigText' of undefined
- "Re-BigText on Resize" is misleading
- passing in the window object
- BigText stops working when required font-size is less than 24px HOT 1
- The latest release is no longer compatible with jQuery 3 HOT 4
- Callback option
- Doesn't work out of the box with webpack.
- bigtext is not a function
- Word spacing goes wrong on iOS Safari
- word-spacing doesn't get adjusted properly in Safari HOT 1
- Not live update when resizing window
- Scroll up when resizing window
- Vertical spacing (line height) with BigText
- Font size is being set too large with embedded font face
- resize event is not properly calculating font size
- Initial text size wrong, but on resize it works HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bigtext.