Work

7/02

Annoying/Helpful(?) Firefox feature

posted by ilya

Here is the one issue that puzzled me for at least fifteen minutes before I figured out the problem:

I have a website staged on my development/local server and it looks just great (well, not really great in terms of absolute benchmarking of design, but the way god print designer intended it). Then I upload the updated files to the live server and all the text is screwed up—everything looks bigger—font size, padding, margin... I refresh the page, refresh again, clear the cache—same story. I check the css rules, they seem identical; check the source—looks good to me. I re-upload the files from the local server to the live one—no luck. Last resort—I scratch my head and close my eyes for a brief moment—even this doesn’t help.

The solution turned out to be simple (aren’t they all?). Sometime earlier I have accidentally changed browser's zoom value (ctrl + + [MS Windows of course!]) for this site. Apparently Firefox remembers these values individually for each site you set your zoom for. Hence, since I didn’t change zoom for the local site, it looked OK, but every time I went to the live site the browser would display the page with the previously defined zoom setting.

I’m not a big fan of this feature, I’d rather prefer zoom to be active for the duration of your browsing session of this page, but not the entire website, or at least reset the zoom value if you closed that site and then came back to it day or week later.

4/15

jQuery mouseover/mouseout vs. mouseenter/mouseleave.

posted by ilya

When working with basic mouse events in jQuery I again, again and again I find myself first using mouseover/mouseout events and then replacing them with the corresponding mouseenter/mouseleave.

The reason is always the same—if you have children elements within your target element, when hovered, they will cause your element to fire mouseout event. In other words, mouse over child element means mouse out for the parent, even though the child is entirely inside the parent:

                     
<div id="parent">
    <p id="child">Hover me and I will make the DIV 
    element fire a mouseout event</p>
</div>

Usually for me this is not very desirable. I want to see the element I’m working with as a single entity, including all children. Here is where mouseenter/mouseleave events come handy—they work the same as mouseover/mouseout, but don’t cause thes nasty parent-child hate behavior.

4/07

Finding out if the child has been attached to stage in Flash ActionScript 3

posted by ilya

Pretty often I need to check if the movie clip is already on stage before I remove it. Without this check, an attempt to remove a nonexistent yields a nasty “Error #2025: The supplied DisplayObject must be a child of the caller”. The mechanism is quite simple. Given that the name of your movie clip is mc, the code is the following:

if(mc.parent != null) { removeChild(mc) }

4/07

I want it bigger!

posted by ilya

At some point in website life cycle (usually after design is approved and moved into HTML production) almost all clients always ask for the same thing—“Make the logo bigger!” I'm not sure what is it, are they trying to compensate for something?

inspiring links

Font Squirrel
Handpicked free fonts for graphic designers with commercial-use licenses. Some really nice fonts.
Graphic-ExchanGE
A great selection of awesome graphic projects