milkshake said:
I have started my redesign I have lots of ideas this is just a demo implamentation of my menu bar, it has css3 transitions that only work in google chrome (including the one on pandora) and safari at the moment apparently they will be implament to firefox 4 or 3.7 but anyway have a quick look, by any means its not complete this is only a demo of a menu and doesnt reflect its final appearance.
http://www.liquidfists.com/demo
tell me what you think.
edit: it also works fine in fennec and Arora (looks odd in Arora though) including transitions.
doesn't show gradiant background in midori but trasition works.
it does work in firefox just without nice looking transitions.
First off, you don't really have to write all of the JS code yourself if you don't want to. Just describe a concept and let me take care of the dirty work
Now for some comments:
The menu as a whole looks pretty nice; very Android-inspired
, but I fear that it'll be problematic to use for non-Javascript-enabled browsers. This shouldn't be that big of a problem, though. It is, however, also problematic for browsers that automatically round style attributes. Chrome 6.0.453.1 does for example convert every CSS size attribute to pixels automatically (so if you specify e.g. 'height: 1em' it replaces it with 'height: 12.4px' or whatever your current font size is). This means that when the user zooms in or out using the browser's zoom feature, it might modify the CSS absolute style values ('width: 180px' might become 'width: 179.99999998px' because of rounding errors in the transformation matrices), making your check ('el.style.width != "180px" && el.style.height != "320px"') fail.
Also, you're using CSS3 for animations, which is problematic for older browsers as you said.
And the thing uses very specific sizes (the toggle button uses pixel size values) which means that if I load a translation for "Menu" like "Översikt" in Swedish, it'll look weird when the text overflows.
Have you considered using jQuery, which will use CSS3 if it's available, and fall back to Java-Script-based animations otherwise?
The jQuery code for the whole animation would be:
Code:
$(function() { //This function will be called on document.onload
$('#menuToggle').toggle( //Register an event handler for the 'toggle' event
function() { //When the menu is clicked the first time
$('#navmenu').animate({
width: '180px',
height: '320px'
}, 500);
},
function() { //When the menu is clicked the second time
$('#navmenu').animate({
width: '24px',
height: '100px'
}, 500);
}
);
});