Closed GoogleCodeExporter closed 9 years ago
Hi
You most likely didn't wait for Hyphenator.js to finish!
There's a callback function called when Hyphenator.js has finished its tasks:
http://code.google.com/p/hyphenator/wiki/en_PublicAPI#property_onhyphenationdone
callback
So this works fine:
{{{
<!DOCTYPE html>
<html lang="de">
<head>
<style>
div {
width:126px;
font-size:20px;
line-height:30px;
}
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="./Hyphenator.js"></script>
<script>
Hyphenator.config({
onhyphenationdonecallback: function () {
var
jQ = $("#myid").height(),
oh = document.getElementById("myid").offsetHeight,
he = document.getElementById("myid").style.height;
alert(jQ + ' ' + oh);
}
});
Hyphenator.run();
</script>
</head>
<body>
<div id="myid" class="hyphenate">Lastenhebemaschine</div>
</body>
</html>
}}}
BTW: Afaik there's no document.getElementById("myid").height;
Mathias
Original comment by mathiasn...@gmail.com
on 15 Jun 2012 at 3:32
Original issue reported on code.google.com by
s...@stegenwaller.de
on 15 Jun 2012 at 7:55