windowWidth = $('content').clientWidth;
$A(document.getElementsByClassName(name)).each(function(element,index) {
// fix only for IE
if (Element.getStyle(element,'padding-left') != null) {
element.style.width = windowWidth - parseInt(Element.getStyle(elemen
t,'padding-left')) - parseInt(Element.getStyle(element,'padding-right')) - parse
Int(Element.getStyle(element,'margin-left')) - parseInt(Element.getStyle(element
,'margin-right'));
}
});
Does good design really make a difference? Implementing software often has no relation to life outside work, where chaos seems to be the rule rather than the exception. You may not be able to control life, but let's not practice chaos when developing software.
Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts
Saturday, February 10, 2007
IE UL width fix
The only way I could get the <ul> custom lists to look right within IE 7 was to use the following Javascript code to adjust the widths os the <ul>:
Monday, January 22, 2007
JavaScript dialogs

I found an extremely useful JavaScript library called Prototype Window which is built on top of Prototype and Scriptaculous. I really like how easy it is to customize and add different skins to the dialogs. I am using this for the dialog that explains how I created the A2D logo. Creating a dialog is easy as this:
var dialog = new Window('modal_window', {className: 'dialog', top:logo_top, left:logo_left, width:logo_width, height:logo_height, zIndex:150, opacity:1, resizable: true});
dialog.setContent('logo_creation');
dialog.show(true);
Labels:
CSS,
dialog,
JavaScript,
prototype,
scriptaculous
Subscribe to:
Posts (Atom)