Categories
Web Development

Preventing iFrame Jump on Refresh

Situation:
An iFrame in the body of a page. A link on the page changes the location, i.e. reloads the iFrame.

Problem:
Whenever the iFrame reloads, the page jumps to the top.

Solution:
Give the iFrame the following code:
In the head portion add a JavaScript function that sets the parent window's scrollTo position to the Y position on the page you wish the page to be in after the iframe loads (e.g. 0,0) if you want it to reload to the top. Then, set the iFrame's body element's onload attribute to call this positioning function.

If WordPress’ new annoying editor worked well, I could have posted the code but apparently I am too stupid to work it out. Plain HTML did not work…

Share
Categories
Computing Web Development

Audio sync issue in Flash

So I am working with Flash 8 at present. I am billable and that counts.
The project involves embedding video and audio clips in the Flash movies we are creating. Once published (compiled, for those who feel bette about that term) – the movies that just had an audio soundtrack exhibited a weird behavior: when you preview the movie in Flash player, the audio would sync just fine with the animation, but when viewing the movies in a browser, the synchronization would be off by seconds, even in 10 second-long movies.
The solution appears in this post on the Macromedia Flash forums.
The audio track must be on its own layer (duh) and the layer should be selected. Open the properties area (if you do not have it showing by default) and in the area where it says ‘Sound’, select the audio you just laid inside of the movie. Then, select ‘Stream’ from the Sync choices, and voila, it’ll sync just fine.

Share
Categories
Computing Web Development

IE border rendering bug

Another Internet Explorer bug for the books:
Create a <div> element and give it a border, something like:

div.product_intro
{
border-width: 0.1em 0.1em 0em 0em;
border-style: solid;
border-color: #ccc;
padding-top: 0.7em;
padding-right: 0.7em;
padding-bottom: 1em;
}

You would expect it to look something like this.

Now scroll down the page so that the div is obscured and outside your viewport (the broswer no longer shows it).

Scroll back up.

This is what I got. Where did they border go?

The fix (so far): Set the width for the div explicitly. That also cures another outrageous bug where IE pushes divs around the aforementioned div with irrational spacing.

Share
Share