Tyler Style

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromTyler Style
ToMe
SubjectMovable Mini Windows script button images slightly broken on minimize
Date9 March 2006 03:16
Hello Mark, my name is Tyler and thanks for reading!  Let me be the 117 000
032nd person to say how amazing your scripts are, and how great it is that
you make them available to us struggling saps!  Oh, and the Web 2.0 site
redesign looks good, I think.

I am quite taken by your movable mini windows, and would like to integrate
them into a site upgrade we're doing (we're a small retail health
supplements company).  I read the previous emails and found your
correspondance with Mark Canada about the mods to allow the window creation
to be done by a function using the DOM and innerHTML.  I had to modify your
solution slightly to get it to work, or it would throw invalid pointer
errors:

your code:
    var foo = document.createElement('div');
    foo.innerHTML = stringWindow;
    document.body.appendChild(foo.firstChild);

my modification:
    var foo = document.createElement('div');
    foo.innerHTML = stringWindow;
    document.documentElement.lastChild.appendChild(foo);

However, this lead to a minor issue in IE5&6 (tho not FF 1.0.x,1.5.x or OP
8.5) on WinXP, ME and 98: when the window is minimized, the graphics for the
buttons don't show.  I haven't been able to puzzle that one out at all, and
would appreciate any advice you might offer.  You can see a live demo at

   [URL]

There is no doctype set for the page.

DON'T surf around the site if you value your sanity...it was created by my
boss's dad using FrontPage as a hobbyist thing, and is decidedly scary.  As
I said, we are in the midst of a remodel.  Definitely do not examine the
shopping cart, it is a hideous mess (early experiment on my part, I have to
confess).

Hope you can clue me in a little, and thanks again for your time!
FromMe
ToTyler Style
SubjectRe: Movable Mini Windows script button images slightly broken on minimize
Date9 March 2006 09:59
Tyler,

> However, this lead to a minor issue in IE5&6 (tho not FF 1.0.x,1.5.x or OP
> 8.5) on WinXP, ME and 98: when the window is minimized, the graphics for the
> buttons don't show.

Hmm, difficult to reproduce this one. I have IE 5, 5.5 and 7 (where your
shine-through bug is fixed, by the way). Only IE 5 showed the problem, but
it worked after a reload. Since then I have not been able to reproduce the
problem at all. I am guessing that makes it a page loading or failed redraw
issue.

There are two things I can recommend;

1. preload the images _before_ trying to create the mini window using the
normal:
var foo = new Image;
foo.onload = function () { ready(); };
foo.src = 'nameofimage.gif';

2. force a redraw after creating the mini window. Usually you can force a
redraw by changing something  on a parent element, such as the className:
document.body.className += '';

Since I can no longer reproduce the problem, I cannot test if these work,
but hopefully you can.


Hope this helps.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromTyler Style
ToMe
SubjectRe: Movable Mini Windows script button images slightly broken on minimize
Date9 March 2006 15:12
Hm.  It does seem to be a caching issue of some kind.  When I restarted my
computer today, the bug disappeared (XP/IE6).  Evil.

Shine thru is SO annoying.  I am debating whether to use css-type drop down
menus instead of selectboxes, but the overhead would be an enormous headache
for me...

Thanks so much for your time, your incredibly prompt response, and the great
scripts!

    Tyler Style
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.