I only have rudimentary JavaScript skills, but I believe that your code probably doesn't work because you forgot to make sure that the page was fully loaded before the script is run. Since I was too lazy to search for a pure JavaScript solution, I simply used
jQuery to check the ready state:
Code:
$(document).ready(function() {
window.frames["f1"].addEventListener("resize", setup);
});
I plugged your slightly modified code into the ePub3 wrapper of the file that I attached to the second post and it appears to be working with ADE 4.5 but pretty much nothing else.
BTW, if you want to create a valid epub, you can't use
position: absolute; in the CSS. epubcheck will also complain about the
name attribute; use
id instead. (The attached file will pass epubcheck 4.)
IMHO, you'd be better off looking for a pure CSS solution. Since you're apparently interested in fleurons, have a look at the
::after pseudo selector. Maybe you could manipulate its CSS rule to achieve the desired result.