Some thoughts about Apple

Apple 2 Comments »

I have some random thoughts about Apple which I do not want to release as single posts on this blog, so here they are in the order of appearance. ;-)

MacBook

Before Christmas I bought myself a present and bought a MacBook in order to use it as my private and partly commercial developing machine. My father always told me to switch to the Mac platform, as he is working with Macs since the Apple //c which was released in 1984... Anyway, since I work a lot with qooxdoo ;-) I also wanted to have a native unix-based working environment.

OS X Console font

I never really liked Apple's default mono space font Monaco. Andale Mono looks much better, but my absolute favorite is Inconsolata.

Multi touch gestures

Since I wrote about mouse gestures I was very excited to see the multi touch technology integrated in the new MacBook Air. I really like to see Apple developing better user interfaces. And hey, I want this gestures for my MacBook, too. ;-)

Celebrating qooxdoo 0.7.3

qooxdoo, Work 1 Comment »

qooxdoo 0.7.3 was released this morning. Being a minor release which includes many bugfixes and improves stability of the framework, this release still is one of the largest in the history of this project. See the official announcement for a list of new features.

Have fun! :-)

Optimization Monday — Part VII: set CSS in one step

Optimization Monday 1 Comment »

Often you need to set just a single CSS attribute in your web application. You will usually do this by applying a value to the specified style attribute.

myElement.style.color = 'red';

Sometimes you will have to set a number of attribute values at once. For example if you have just created an element and can not assign a CSS class, because all attributes depend on specified conditions. In this case it is significant faster to set a value for the whole style attribute instead of setting each CSS attribute.

This five assignments

var myDiv = document.createElement('div');
myDiv.style.backgroundColor = 'blue';
myDiv.style.border = 'solid 4px red';
myDiv.style.fontFamily = 'Helvetica, Arial';
myDiv.style.width = '400px';
myDiv.style.height = '100px';
 

can be combined into one

var myDiv = document.createElement('div');
myDiv.setAttribute('style', 'background-color:blue;border:solid 4px red;font-family:Helvetica, Arial;width:400px;height:100px;');

If you are dealing with dynamically created elements, be sure to read part three of this series. ;-)


WordPress Theme & Icons by N.Design Studio
Entries RSS Comments RSS Anmelden