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.
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.
Not only its still 3 Euros listed for me but it doesn't seem to even support newer versions of Android, it just tells me it's incompatible with my device. EP2 works.
I have seen what it takes to uninstall co-pilot, it is not elegant and certainly not a straight forward Uninstall. Can't they just do what Apple have done, and just have a setting to turn it off?
i don't get all this pushing/forcing to get people to use Ai or get people to have accounts and that sort of thing. If people want to use the services, then they will, they don't need pushing.
They push/force, then they get people like me who looks on it with suspicion and find anyway to disable or not use the service
So what happens when all These AI services have grabbed all the data from humans and have to then start grabbing data a from other AIs?
So we will get more false info made up by machines, I feel sorry for the younger generation, they will not know what is real and what is not.
It can be done, I have done it in the past, but Windows goes wild getting new drivers and moving stuff around. I think it is better these days, but as other have said, always better to do a fresh installation.
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