- In the extension bar, click the AdBlock Plus icon
- Click the large blue toggle for this website
- Click refresh
- In the extension bar, click the AdBlock icon
- Under "Pause on this site" click "Always"
- In the extension bar, click on the Adguard icon
- Click on the large green toggle for this website
- In the extension bar, click on the Ad Remover icon
- Click "Disable on This Website"
- In the extension bar, click on the orange lion icon
- Click the toggle on the top right, shifting from "Up" to "Down"
- In the extension bar, click on the Ghostery icon
- Click the "Anti-Tracking" shield so it says "Off"
- Click the "Ad-Blocking" stop sign so it says "Off"
- Refresh the page
- In the extension bar, click on the uBlock Origin icon
- Click on the big, blue power button
- Refresh the page
- In the extension bar, click on the uBlock icon
- Click on the big, blue power button
- Refresh the page
- In the extension bar, click on the UltraBlock icon
- Check the "Disable UltraBlock" checkbox
- Please disable your Ad Blocker
- Disable any DNS blocking tools such as AdGuardDNS or NextDNS
- Disable any privacy or tracking protection extensions such as Firefox Enhanced Tracking Protection or DuckDuckGo Privacy.
If the prompt is still appearing, please disable any tools or services you are using that block internet ads (e.g. DNS Servers, tracking protection or privacy extensions).
Question
jordan.
Hi all,
A while ago I had someone create a sliding bar effect for a website I was working on. If you check out the site linked below, you will see the sliding bar thingy that I am talking about where it says "Tona Boards" on a sort of green arrow, then it slides back and forth to reveal different text.
http://www.tonaboards.com/
Now there is just one small problem with it. There is always this unnecessary amount of extra space after the text if the line of text is quite long. This is a result of a poor calculation for the width of the arrow. Currently this is how the width of the arrow is calculated:
var width = titles[title_id][0].length * 15;
Basically, he is just multiplying the number of characters by 15 to get a close (but not accurate) pixel width that will fit the text.
Is there a better way to work out the exact amount of pixels a line of text takes up? I did some googling and it seems possible but I am a javascript noob and can't figure out how to incorporate any of the examples in to my particular code.
Here is the full javascript for the sliding arrow.
http://www.tonaboards.com/wp-content/themes/TonaLife/arrow.js
Cheers for any help.
Jordan
Link to comment
https://www.neowin.net/forum/topic/935436-javascript-determine-length-of-text-in-pixels/Share on other sites
8 answers to this question
Recommended Posts