Create jquery loop with some calculations and logical events
$30-250 USD
Terminado
Publicado hace alrededor de 10 años
$30-250 USD
Pagado a la entrega
This is a description that you will find in the [login to view URL] file below. you will understand this once you see the code inside. you need the js file for it to work.
at this stage you'll see that NOT all text is showing in that box, because of the fixed height and width this plugin doesn't print it. with this plugin i want to figure what is the biggest usable font-size and line-height combination in px or em (which ever can be more precise)
I am available for chat. Please questions. I will not award this to you without me knowing you understand fully want i want.
Thanks
Jan
//change function dotdotdot into something that would do this below //
/*
When truncated (when some text is missing due to not fitting in) =>
=> look for font-size and font-height of element - this could be also looking for multiple elements so then you'd use .each()
=> goal = find the biggest font-size and line-height possible without triggering truncated
the smallest font = 9px
the biggest = the font the was found
ratio between font-size and line-height
line-height has to be always 2px to 5px bigger than font-size.
so for example:
when load = text is filled and truncated is triggered.
we know the height and width, we also know the font-size and line-height by checking for them,
now we run a loop
if truncated
apply this css font-size = font-size - 1;
if not truncated, keep this
if still trucnated
apply line-heght = line-height - 1;
if not trunscated anymore
apply this line-heght = line-height + 1; this one is to see, if we could stretch the font little bit, if it goes back to truncated, then take that back, if doesn't keep it
IF THIS CAN BE ACCOMPLISHED WITH BETTER PRECISION BY USING em INSTEAD OF px THE PLEASE DO THAT
Hello! This can be accomplished without a loop. I can do it with an equation. It will take me about 3 hours (including testing). I can start right now.