OZONE Asylum
Forums
DHTML/Javascript
Playing with js
This page's ID:
29574
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Not bad for a first JS prod. Regarding the other thread I think you mean [28377]. Just a few quick suggestions:[ulist]* a decToHex() function can be shortened to: [i]function d2h( i ){ return ('0'+i.toString(16)).slice(-2); }[/i] * Actually you don't need to call DecToHex in your main loop. Notice that it is always called with a value in the range [ 0 ; 30 ] [small](x5)[/small]. Simply precompute an array with the 30-31 entries you need and voilà. you just replaced[code] if ( i == m ) { c = '00'; } else { c = decToHex(i ¤ 5);} if (c.toString().length < 2) {c='0'+c;}[/code]by[code]var c = lut[i];[/code] * using CSS will get rid of all the redundant style declarations in the A tags, so that you only have to set the [i]left[/i] and [i]top[/i] for each of them. You can even go further by floating them, or simply use a small [i]letter-spacing[/i] and [i]line-height[/i] / [i]margin[/i] * using [i]document.write()[/i] for each "pixel" is quite intensive. Maybe you should only [i]document.write()[/i] in the Y loop. * Also [i]document.write()[/i] is kinda oldschool, but for such a program it does the job. So would the equally evil ( in normal conditions ) [i]innerHTML[/i].[/ulist] [url=http://www.p01.org/][img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_neon88x31.gif[/img][/url] [small](Edited by [url=http://www.ozoneasylum.com/user/2185]poi[/url] on 10-01-2007 13:52)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »