Warning: file(milov_entryform.tmpl.php) [function.file]: failed to open stream: No such file or directory in /home/milo/domains/milov.nl/public_html/class.template.inc.php(282) : regexp code on line 1

Warning: implode() [function.implode]: Invalid arguments passed in /home/milo/domains/milov.nl/public_html/class.template.inc.php(282) : regexp code on line 1
milov.nl: by category: javascript

1-48 of 50 entries in category 'javascript'
pages: 1 2

something new 

117.milov.nl - a bit of fun with border-style: dashed;.
Exact rendering depends on browser model and window size. Warning: hypnotizing!

1. posted by Low at 10:19 on July 30, 2008

After almost 4 years! Sweet!

2. posted by Dal Jean at 16:39 on July 30, 2008

wow, interesting work!

3. posted by Marc at 23:00 on August 02, 2008

Heh, I thought the hair grew back permanently. Nice effect though! ^-^

4. posted by battez at 20:48 on September 28, 2010

wow, inspiring experiments milov! By the way I love your photographs, really great - I especially love creative use of cropping and composition, but they're not the only highlights =)

5. posted by battez at 20:48 on September 28, 2010

more framing than cropping I mean, sorry.
add a comment

Flickr view big bookmarklet 

I wrote this little bookmarklet to help me instantly grab the large/original version of any Flickr photo. Funnily enough, because of Flickr's consistent filenaming scheme, it also works for photos where the See different sizes option normally remains hidden:

view big (gets 1024px version; should work for most photos)

view original (gets full version as uploaded; works for photos pre-March 2007)

Drag the link above to your Bookmarks Toolbar (or right click, Add to Favorites), then click it when viewing a single Flickr photo page.

Here's the formatted source code, if you're into that sorta thing:

for (m in M=document.getElementsByTagName('img'))
{
  s = M[m].src;
  if (s && s.match(/static/) && !s.match(/_s|buddy/))
  {
    void(window.open(s.replace('.jpg','_o.jpg'),'_self'));
    break;
  }
}

1. posted by Ivan at 15:46 on October 28, 2005

wow very smrt and handy

2. posted by Nick at 16:19 on October 28, 2005

Thanks for sharing this!

3. posted by Ruben at 17:46 on October 28, 2005

You sneaky hacker! ;-)

4. posted by Konstantinos at 01:06 on November 08, 2005

Very nice! Can it be modified to work for PNGs as well?

5. posted by kwota.net,chris,chris at 02:29 on November 03, 2006

I call it Bigr. Awesome.

6. posted by hccnet.nl,r.j.m.vermeulen,r.j.m.vermeulen at 10:23 on January 18, 2007

hi MILO
I saw your photos
PaRob

7. posted by francis at 00:11 on February 06, 2007

this is really great i can use this on pc with windows
but with osx on my mackbook it dont work ;(.

8. posted by juice at 01:56 on March 07, 2007

Doesn't seem to work under FF2 in Windows :-(

9. posted by James at 14:13 on March 07, 2007

If you replace (s.replace('.jpg','_o.jpg') with (s.replace('.jpg','_b.jpg') rather than getting the original you can view the large version (1024x800).

Flickr have added a security feature to help protect the original.

10. posted by Milo at 14:28 on March 07, 2007

Good point James. For the time being I've just split the bookmarklet into two version: one for _o and one for _b.
add a comment
New bookmarklet: counters
(drag to Links-bar or right-click to Add to Favorites)

Tested in IE6 and Firefox. For every mouseclick, a small [1], [2], [3] incrementing counter will appear. Handy if you want to easily count the number of times something occurs on a page, such as the number of films you've seen of a specific IMDb actor/director (which prompted this idea in my case).
read more »

1. posted by Mathieu 'P01' HENRI at 10:01 on June 30, 2005

Aside drawing yellow moustaches on a page, what kind of use can you make of it ?

2. posted by Milo at 11:05 on June 30, 2005

Well, count stuff, obviously :)
Now I know I've seen 23 Susumu Terajima films... http://imdb.com/name/nm0855398/

3. posted by Milo at 11:07 on June 30, 2005

Also handy for finding out how many of the top 250 movies you have seen: http://imdb.com/chart/top

4. posted by Mathieu 'P01' HENRI at 15:37 on June 30, 2005

Lousy me, I thought of something slightly beyond simply counting stuffs :p

Like adding a note.

5. posted by Milo at 15:40 on June 30, 2005

Something like this? (Try the 'notes' link above)
I'd expand it with the option to edit and move current notes, but I'm sure somebody else has already built this...
:)

6. posted by Mathieu 'P01' HENRI at 18:15 on June 30, 2005

It'd be cool to have the numbers, and that the note appear on hover of them. Gosh, why am I at work while I could fiddle on the bookmarklet :p

But yeah, you are certainly re-inventing the wheel.

7. posted by Mathieu 'P01' HENRI at 15:04 on July 01, 2005

add a comment

1. posted by Mathieu 'P01' HENRI at 16:16 on May 12, 2005

o_O I didn't knew the in statement could be used outside of a "for( iterator in object )"

2. posted by Milo at 16:22 on May 12, 2005

Now that I think about it, unless I'm missing something, one could also simply use:

var TypeInSet = nodeType in [2, 3, 4, 7, 8];

...thus bypassing the need for the custom set() function.

3. posted by Milo at 16:27 on May 12, 2005

Oh wait, I am indeed missing something :)
in checks the *index*, not the values, so my idea makes no sense at all.

4. posted by Mathieu 'P01' HENRI at 16:39 on May 12, 2005

:)
It's not exactly the indexes. It's the name of the properties ( member variables ) of the object.

5. posted by Milo at 16:43 on May 12, 2005

True... but with regard to arrays I always think of those as 'string-based indexes' ;)

Anyway, to make something that *does* work for array literals, I came up with this:

Array.prototype.contains = function(n)
{
for (var i in this)
{
if (this[i] == n) { return true; }
}
return false;
}

var typeInSet = [2, 3, 4, 7, 8].contains( nodeType );
add a comment

1. posted by huphtur at 16:12 on April 04, 2005

disabling styles on the clock example gives an interesting design

2. posted by Mathieu 'P01' HENRI at 22:57 on April 13, 2005

o__Ô interresting indeed. It looks like a binary clock. I nether thought to disable the CSS before.
add a comment

1. posted by Low at 15:06 on February 21, 2005

Now that's just silly.

2. posted by Jan! at 16:55 on February 22, 2005

Vast minder programmalogica voor nodig dan voor een 3D-versie: http://jan.moesen.nu/media/images/screenshots/2005/20050112-tetris-3d-screenshot.png

3. posted by Milo at 17:04 on February 22, 2005

Looks pretty impressive Jan! That takes me back... Do you know Block Out? http://www.dosgamesonline.com/index/game/Block-out/38/
The same thing but from a different perspective.

4. posted by Jan! at 20:53 on February 26, 2005

Hot damn, Block-out! That's been ages! No wonder my version felt so familiar in top-down view. :-)

5. posted by Spence at 21:25 on February 26, 2005

i am loving that... i am going for the top score, i have 6 million points so far
add a comment

1. posted by Mathieu '¨P01' HENRI at 13:35 on December 16, 2004

^__^ the world is small. Glad to be in your quicklinks.

2. posted by Jan! at 16:10 on December 16, 2004

Nice one, Mathieu!

3. posted by Milo at 17:32 on December 16, 2004

Glad to quicklink you, anytime :)
I just tried the Zoom bookmarklets at http://milov.nl/703 on it, it even works when zoomed in!

4. posted by Mathieu 'P01' HENRI at 18:03 on December 16, 2004

Thanks.

Afair there's a little ( and certainly ridiculouslty easy to fix ) bug then you die in IE.

Milo: no need to use your bookmarklet there's an alternate stylesheet to zoom it by 2 ;)

5. posted by Milo at 18:14 on December 16, 2004

Cool. Why not set that one as the default?

6. posted by nowak at 21:49 on December 16, 2004

full circle.

As an aside, there needs to be a 2005 256b compo. I miss those.

7. posted by Mathieu 'P01' HENRI at 22:18 on December 16, 2004

nowak: yep! at the time Mados asked me if I were ok to organize a 256b.htm contest but I declined as I would forbid myself to submit a prod :p

Milo: indeed the zoom x2 stylesheet is more playable :p
add a comment

(unfinished) code dump 

sparks
Drag a pattern with left mouse button to make "sparks" appear. Animation is created by cropping, moving and fading one single .gif circle.
sen9 aka three-letter-poet
Mouse movements generate random three-letter-strings. When it hits an actual existing english three-letter-word, the word is added to the main sentence (click to start a new sentence).
sticky drag blocks
Drag-and-drop collision-detection experiment.
bgrotate
Multiple layers of a simple pattern rotating at different speeds (runs a lot faster in IE than in Firefox).
slanty
slanty2
Trying to do something interesting with css border slants. Update: broken in IE at the moment.
zllm
zllm2
Attempts at a shrinking zoom-effect by applying smaller and smaller relative (%) sizes...

1. posted by Mathieu 'P01' HENRI at 13:53 on November 20, 2004

I really like how you made the animation in sparks.

The sticky drag blocks and zllm2 are also really cool.

All these scripts would be a great addition to your IAMBALD serie.

2. posted by iname.com,mrmessiah,MrMessiah at 17:06 on November 20, 2004

Oh yes... zllm2 is great, especially if you trace your mouse round the edge of the screen in a circle.

3. posted by ACJ at 05:07 on November 21, 2004

Awesome stuff, Milo! I just love design/art experiments with code. I've started playing around with PHP, Python, SVG, XML, CSS, and PNG (and all sorts of combinations of it) for that kind of thing again recently.

4. posted by steven streight aka vaspers the grate at 09:44 on November 21, 2004

What words are BIS, KAF, and ROC? Not English as far as I know.

Do you like John Maeda's games? Try going to his web site www.maedastudio.com I think is the URL. Some nice games there.

5. posted by Kapp at 11:15 on November 21, 2004

Ecce Milo Vermeulen.

6. posted by adjam at 22:47 on November 21, 2004

hey milo!
this stuff is really cool!
i love it when u make this cool experiment and the circle stuff is definatly really cool ill look at its code sometime!

7. posted by toph at 05:35 on November 22, 2004

god sea ewe

8. posted by Kethinov at 18:02 on November 22, 2004

What is this stuff not doing at i.am/bald? Is it exclusively a java applet club now? :-\

9. posted by Milo at 18:30 on November 22, 2004

Basically, none of these are good/elegant/solid enough to become nr. 115 (although I'm now thinking sen9 could be if I clean up the dictionary some more).

By allowing myself to classify things as unfinished/dump, the threshold for release is a lot lower, and it's nice to get things out there in this form; I hope to do more posts like this.
add a comment

using :visited and expression() to detect any visited link 

There's been some talk (see Anne, CollyLogic) about it being possible to use the :visited pseudo-class and background-image urls to detect if a user has visited a particular link.

Luckily for Internet Explorer users, they are unaffected because IE doesn't support the [href=] selector. Unfortunately, there's another method that does work in IE and is even more dangerous...
read more »

1. posted by Thiemo at 16:02 on May 26, 2004

What's so dangerous about this? You can do the same since HTML 1.0:

<a href="tracker.php?url=slashdot.org">

2. posted by P01 at 16:02 on May 26, 2004

It's possible too extract all the URLs of the HTML markup to create the corresponding CSS rules for the standard compliant browsers, and finally throw the HTML + the extra CSS rules to the client.

Indeed, if the tracker.php script goes recursively through the pages visited by the user it can reveal some really valuable infos ( imagine the extra incomes an ad system could ask if it implements that sort of sniffer ) and eventually set a breach for the sites using an authentication via the parameters sent in GET ( which is whatever, a security no-no ).

The violation of privacy could reach an higher scale if the spamming companies used that exploit ( if don't already do ) in their mails.

3. posted by milov at 16:07 on May 26, 2004

Thiemo, the big difference is is that with this technique, the visitor doesn't *click* on a link at all. Simply loading a page of links is enough to alert the site owner of which of those links the current visitor has visited before.

4. posted by Jan! at 16:12 on May 26, 2004

Also, if you're serving dynamic pages anyway, you can just as well add an id attribute to every link, and style it in CSS with: #link857456 { background: url(tracker.php?id=link857456) }

Apart from that, I don't get why everyone's upset all of a sudden when this has been known (and applied) for years.

5. posted by Thiemo at 16:20 on May 26, 2004

If a particular URL is in my browsers history or not does not mean anything. (What's important here: You can't read the history. Instead, you have to know the URL first!) Turn off your internet connection if you are afraid of being tracked.

6. posted by milov at 16:36 on May 26, 2004

Jan!: You're right, with a dynamic site this whole expression() trick isn't really needed. And I wouldn't say I'm 'upset' or worried, just disappointed I didn't discover this cool (and indeed rather obvious) trick earlier ;)

7. posted by Andrew Clover at 12:32 on May 27, 2004

Indeed known about for some time. I mentioned this issue in a post to Bugtraq a few years ago:

http://www.doxdesk.com/personal/posts/bugtraq/20020214-css.html

There is no obvious good solution.
add a comment
A checklist of i.am/bald numbers I really should update since they don't work or no longer work in Mozilla Firebird (my default browser for over a year now):

10, 14, 20, 23, 25, 26, 28, 30, 31, 33, 34, 35, 36, 37, 39, 40, 42, 44, 45, 46, 49, 50, 51, 55, 56, 57, 62, 65, 66, 67, 69, 71, 72, 73, 74, 77, 79, 90, 92, 94, 95, 96, 97, 98, 99, 102, 108, 109, 112, 113.

1. posted by adam at 09:25 on January 14, 2004

You got heaps of work to do, mate.
add a comment

integrating javascript into stylesheets 

Ben Nolan's non-link element hovering trick for Internet Explorer (that normally only allows :hover styles on links) is pretty handy, but what really impressed me about it is his way of integrating arbitrary Javascript functions into the stylesheet itself:
body {
  background: url("
    javascript:
      document.body.onload = function(){
        ...custom js here...
      }
  ");
}
By specifying a rule like this in the browser's user stylesheet, it might even be possible to run a custom set of Javascript commands on opening of any visited website. (Although my brief attempt at making this work proved unsuccessful.) [via webgraphics]

1. posted by Ruben at 13:26 on January 07, 2004

It is really interesting indead. I already read the discussion thread in the forum of Tweakers.net, see:

http://gathering.tweakers.net/forum/list_messages/831654/last

The interesting part is that it is somehow specified in the W3 specs of CSS2, see:
http://www.w3.org/TR/REC-CSS2/generate.html#content
http://www.w3.org/TR/REC-CSS2/media.html

2. posted by Richard Soderberg at 01:01 on January 13, 2004

The spec also specifies that "Generated content does not alter the document tree. In particular, it is not fed back to the document language processor (e.g., for reparsing)".

It seems IE is ignoring this directive, which I think is right.

3. posted by Richard Soderberg at 01:13 on January 13, 2004

IE is right, that is. Not the directive. I think the directive is shor-sighted and limiting -- but in the face of embedding active content in CSS, well, maybe I can see their point of view.

4. posted by bob at 17:51 on May 27, 2006

cool

5. posted by A to Z of World at 10:32 on January 15, 2007

I did try it and indeed is handy. But as expected I'm not finding a situation to put it in real time usage as I rarely need something which works only with IE :)

6. posted by hotmail.com,ddrmax4ever,Derek at 17:48 on January 18, 2008

i cant seem to make it work for the way i thought of. I was trying to embed onmouseover and onmouseout functions to work. Anyone is willing to give me insight?Just send me an email, thank you
add a comment
The Javascript Raytracer has been expanded quite a bit since we last saw it... now you can even use it to build your own custom scenes (see the extensive Help-section).

1. posted by Kid A at 19:44 on December 27, 2003

Hello , Are you there ?
add a comment
svendtofte.com - max-width in Internet Explorer - using the IE expression() syntax to simulate the css max-width property, which works in Mozilla/Opera but not in IE.

1. posted by Tom Lee at 21:56 on March 16, 2006

add a comment
DHTML Lemmings - Whaaa... Amazing entry for the GoT DHTML Contest. [via 2lmc spool]

1. posted by P01 at 01:24 on August 16, 2003

Really cool!
I've always wanted to port Lemmings but never found the time and energy.

It even features some keyboard shortcuts.
I'm curious to see how he managed the collision detection.

2. posted by crisp at 02:50 on August 16, 2003

Basically there is no need for collosion detection; the game plays in a grid, and the lemmings just follow it. Blockers have their own code in the grid itself (this is still buggy).
It's nice to see that people like it!

3. posted by P01 at 05:12 on August 16, 2003

crisp: That's some quick feedback. You must be quite attentive to your logs these days ;)

My curiosity had already guided me to the data structure of the levels :p clever encoding BTW.

I wonder if a particular reason urged you to pre-zoom the images by 2. Coz there's ~540 Kb of pictures which could be shrinked to ~270 Kb.

4. posted by crisp at 14:30 on August 16, 2003

It's been a bomb since the link got out, and I didn't do it. My homepage generated 3GB datatraffic just yesterday (against a normal 30/40MB daily) so I started looking.

As for the images: I am using the levels as a background image and CSS doesn't let me resize backgrounds.
I might be able to put those in a layer as an image, that would indeed save a bunch. Thanks for the tip!

5. posted by P01 at 02:41 on August 17, 2003

3 Gb O__O

Why not simply double the size of the images by changing there width and height attributes ? If you don't want to store the value of those attributes for each image, you can retrieve them once an image is loaded and then double them. It works from NN4,IE+ to any recent browser.

BTW, if your server is not yet crawled, I think your games would find a place of choice on http://www.javascript-games.org/

6. posted by crisp at 03:20 on August 17, 2003

I already updated the current version reducing the image sizes by more than 50% and added some music and sound effects as I went along :)

My server as a matter of fact was crawled - 7GB in just 2 days which is over my limit, but my friends at tweakers.net where happy to host it for me: http://crew.tweakers.net/crisp/lemmings/

I'll have a look at that link of yours! :)

7. posted by milov at 16:40 on August 17, 2003

I changed the link to point to the new location. Look at all the people linking/talking about your lemmings:
http://www.google.com/search?q=dhtml+lemmings

8. posted by crisp at 03:57 on August 18, 2003

It's truly amazing what is happening here; I've got a couple of hundred sites linking to it now and I get a lot of mail these days; the old games still rule... ;)

9. posted by andy at 18:17 on August 18, 2003

Where can I get a copy of the code?

10. posted by crisp at 00:25 on August 19, 2003

11. posted by P01 at 15:51 on August 19, 2003

The main request expressed by the audience is that it needs more levels, and a wider browser support ( i.e. Mozilla, Konqueror )

12. posted by milov at 15:56 on August 19, 2003

Mozilla support is already there, though? In fact, I haven't viewed it in anything *but* Mozilla.

13. posted by crisp at 17:12 on August 19, 2003

I'm currently working on 6 new levels which are also a lot harder than the current ones. It takes time though to rework the graphics and setup the levelcode; around 3 hours per level.
I've tested this thing in Mozilla1.3+, Opera7, IE5.5 and IE6 so browsersupport should be ok. All other browsers that don't work for this probably lack some support or are just buggy.
Music support is another thing; IE for windows is no problem, but getting it to work in any other browser is a real pain (plug-in sniffing and such).
And then offcourse there's still some bugs to fix; especially in the more complex levels imperfections start to show.

Remember that this is just a work in progress; the entire publicity it got was totally unintentional and way too early.

14. posted by P01 at 21:24 on August 19, 2003

Apparently it doesn't work on Mozilla/Linux nor on Konqueror. But I haven't test those platform myself.

For the music support I suggest you to in touch with Scott SCHILLER ( http://www.schillmania.com ) would did a really good conversion with his DHTML ARKANOID. AFAIK he uses FLASH 5.0 to handle the sound.

Regarding the creation of the levels, I'm sure you could make an API ( even in PHP with GD ) that reads an in image of the level with a color by type of material ( void, blocker, soft, lava, water ... ) and generates the strings you use in Javascript. Don't bother to contact me if I can be of any help and save you some hours on that topic.

Don't worry, I know this is a work in progress. A good one indeed.

15. posted by crisp at 21:46 on August 19, 2003

I have reports from people running it without problems in linux with a recent mozilla version.
Konqueror as well as Apple's Safari which is based upon Konqueror's rendering engine (KHTML) is apparently lacking some CSS2 support and maybe some javascript-HTML bindings I'm using. I neither have a linux nor a Macintosh platform available to test what exactely it is though, so I don't know if I can work around it.

I'm still looking for better ways to support sound in alternative browsers, but flash is out of the question because it is not in the spirit of this project ;)

I already do have a script that generates the level code for me (actually it is PHP with GD ;) ) but the screenshots still need a lot of work, and I have to fit in the animations pixel-precise, creating smaller images to block off parts of the animation that should not be visible and putting these images on top of it.

Thanks for thinking with me, I appreciate it! :)

16. posted by crisp at 10:45 on August 29, 2003

Down thanks to the BREIN foundation... :(

17. posted by P01 at 13:27 on August 29, 2003

°__°

I would understand if they complain about the sprites or the sound track but the code ... ? I guess those companies have a whole department dedicated to the protection of their rights and registered trademarks but they didn't managed to prove hey actually owns the Lemmings(TM)

You've had a really pragmmatic attitude. Bravo.

Now, I can't wait to play Brainless!
add a comment
Digital Web Magazine - Keep Javascript Simple - Peter-Paul Koch argues against external Javascript libraries, which often needlessly replace already quite compact-and-compatible DOM statements.

I could've probably moved a lot of iambald-code into a single DHTML library, but never really felt the need--more so after I gave up trying to support Netscape 4. Plus, I like the fact that visitors can simply View Source a page and see the whole code without having to go searching through separate .js files. [via paranoidfish.org]
ugly :(
document.myForm.myInput.value
document.someImage.src


pretty :)
document.forms['myForm'].elements['myInput'].value
document.images['someImage'].src

1. posted by avoid.org,void,void at 21:06 on November 14, 2002

You are so right! It's like comparing XHTML to HTML. Maybe it's time for XJavascript?

2. posted by Eric at 21:06 on November 14, 2002

Wrong
Less code = pretty

3. posted by Mario at 03:29 on November 15, 2002

If it works, that's ok.
The goals sometimes justify the ways.

4. posted by Jan! at 12:10 on November 17, 2002

>Wrong
>Less code = pretty
Less code == more prone to errors

<form name="search">
<h2><img name="search" src="search.gif" alt="Search!"></h2>
<p id="search">This is a search form</p>
</form>

'document.search', say you?

5. posted by Liorean at 14:07 on November 20, 2002

The document.<formName>.<elementName> syntax instead of document.forms[<formName>].element[<elementName>] was one of the worst mistakes made at Netscape in creting the language - and Microsoft didn't make it especially much better.

How should you handle a form named "forms" with a child element named "forms", for instance? document.forms["forms"].elements["forms"] is the full format - but does document.forms["forms"] not reference by short form the element at the same time it by full form referece the form? Or how about an element with the id "all" in IE?
add a comment
gamebutton arcade - tiny playable Javascript games contained within html form buttons! [via Boing Boing]
dhtml asciifire (IE4+) [by mados] - wow, check out the seemingly simple sourcecode. I like his trick for generating a custom array of characters:

char=' .:*sS#$'.split('');
instead of
char=new Array(' ','.',':','*','s','S','#','$');

1. posted by Jake at 15:55 on September 26, 2002

Well... Huh.
That *is* clever. I love split().

2. posted by Adjam at 15:00 on September 27, 2002

Agh! i just found out lows blog is written entirely in a language that i dont understand! doh!

3. posted by milov at 15:08 on September 27, 2002

tell me about it... ;)

4. posted by Low at 15:19 on September 27, 2002

Who? What? When? Where? Why? How?

5. posted by milov at 15:38 on September 27, 2002

Zijn we nu helemaal gek geworden?

6. posted by Low at 15:55 on September 27, 2002

Ik niet hoor. De rest wel.
Bij de weg, wordt het niet een beetje uit-onderwerp hier?

7. posted by milov at 23:09 on September 27, 2002

Eens kijken of Adjam nog eens reageert, als ik een nederlands berichtje plaats met zijn naam er in...

8. posted by Adjam at 11:07 on September 30, 2002

This is the translation i got (as deutch is so unpopular i had to translate it 1 word at a time :/)

once consider of ADJAM another agree "reageert" acknoledge I a holland "berichtje" above-all about act name appear OK

9. posted by Adjam at 11:07 on September 30, 2002

I have too much free time

10. posted by milov at 11:22 on September 30, 2002

Heheh... What I said was: "Let's see if Adjam comments again, if I post a dutch message with his name in it..."

You could have also tried http://www.tranexp.com:2000/InterTran
(Dutch -> English):
"Sometimes watch whether Adjam encore test tube , when I one Dutch tidings yard with one's reputation yonder within."
add a comment
I just added a little extra javascript for Internet Explorer users, to apply some handy filters to any photo featured on this page:

- Shift-click a photo: Rotate 90°, 180°, 270°;
- Ctrl-click a photo: Desaturate (remove colours);
- Alt-click a photo: Invert colours.

Try it with some of the photos below! You can even combine filters. All this by setting one global document.onclick event (no need to add specific tags to each <img>-tag). View Source to see how it's done.

1. posted by Low at 16:30 on September 10, 2002

*click* *click*
Fun for hours!! :-)

2. posted by jpk at 18:33 on September 10, 2002

very nice!

3. posted by Eduardo at 19:34 on September 10, 2002

Good resources man.. Folks here in the office was jon with your pic (The Hard Disk), I make a quizz with it by eMail.. (What is on the pic?)Cool!

4. posted by Fidel at 19:44 on September 10, 2002

Milo that is l33t! you never cease to amaze me with your skillz.

5. posted by [unknown] at 23:05 on September 10, 2002

davvero divertente, Milo!

6. posted by walter at 23:29 on September 10, 2002

This is just too much.

7. posted by Mario at 05:51 on September 11, 2002

A-M-A-Z-I-N-G

8. posted by mados at 19:51 on September 11, 2002

Impressive. Don't forget to add "return false" for clickable images, e.g. http://milov.nl/entry/1450

9. posted by milov at 20:12 on September 11, 2002

Good point, mados...
This does bring up the problem of what to do when someone shift-clicks an imagelink to open a new window; do I apply the filter or do I let them open it? should I use some other key combination?

10. posted by 23JUL at 10:52 on September 12, 2002

element :- onmouseover
filter :- accesskey
hehe :- fun

11. posted by Ruben at 20:32 on September 12, 2002

Ach, je wist al lang dat je briljant was, dus dit commentaar van mij is compleet overbodig :-)

12. posted by David at 11:30 on September 21, 2002

cool
add a comment
How to extend the convenience of being able to shift-click links and open them in a new window to forms:

<form onsubmit="this.target=event.shiftKey?'_blank':'_self'">

Try it with the search-form (bottom of menu column): holding shift while submitting will open the search results in a new window.
Optimizing Javascript for speed - detailing some clever and interestingly named techniques: Loop Unrolling, Reverse Loop Counting, Loop Flipping and something called Duff's Device. [via scottandrew.com]
Wow, creating something interesting in under 256 bytes (for the 256b.htm compo) isn't easy... Here's one of the things I had to scrap: a random inkblot generator, way too big at 384 bytes... ;)

This one uses the XBM img src technique to generate a 2-bit image at run-time (example 1, 2). Could try rendering it with divs instead, but that'll probably cause quite the browser-freeze.

1. posted by huphtur at 18:35 on February 02, 2002

2. posted by iname.com,mrmessiah,mrmessiah at 02:42 on February 03, 2002

Hehe :) Well I only got mine to work by
absolutely *butchering* the correct
syntax... lots of illegal script and
html tags that IE fills in, but it
fails on just about every other browser
out there, not how I normally like to
code :)

3. posted by Tracy Hall at 00:43 on February 03, 2006

That's a nice little script you've got there. I've had an inkblot generator of my own on my page for years, but it only produces PostScript files. Coming across this page has inspired me to add a couple of .xbm-producing pages, using both my original inkblot algorithm and a modification of your idea of using a random walk.

http://www.math.berkeley.edu/~hthall/Fractal_Inkblot.html
http://www.math.berkeley.edu/~hthall/Brownian_Inkblot.html

Thanks!
add a comment
Another new thing: comments are now loaded by Javascript and appear inline in the current page. So you don't have to leave the page to read the comments for a particular entry (IE-only, right now).
Reference: PPK's Import XML Document tutorial.

1. posted by milov at 20:36 on January 25, 2002

See, here's one! (I hope this works...)

2. posted by milov at 20:37 on January 25, 2002

What I'm still working on is the ability to *post* a new comment without forcing a reload.

3. posted by pup at 20:38 on January 25, 2002

noice.

4. posted by Mypalce.com,Adam,Adjam at 22:19 on January 25, 2002

nice

5. posted by karma at 23:05 on January 25, 2002

sweeeet

6. posted by huphtur at 23:38 on January 25, 2002

milov: when ya gonna make yur cms available for download?

7. posted by milov at 00:54 on January 26, 2002

what cms? you mean the textarea's i've got hidden all over the place? :)

8. posted by huphtur at 01:26 on January 26, 2002

exactly! how much if i wanted to buy it? hehe

9. posted by 23JUL at 04:43 on January 26, 2002

>What I'm still working on is the ability to *post* a new comment without forcing a reload

- I think * posting * always requires some kind of reload, but what do you exactly mean by 'reload', the fact a script is redirecting??

- Another way of 'posting' without a reload is maybe to store the comment as a (-if javascript-) cookie which is being read&deleted as you run the script mentioned here above... ;-)

- Btw: since comments are not in a fixed font, can you use the same font-family in the style of the textarea I am now typing in.

- Later..

10. posted by milov at 09:38 on January 26, 2002

By 'reload' I mean the fact that you see the whole page being reloaded or jumping to another url. It should be possible to post a comment by submitting a form in a hidden iframe, or changing an image src, or indeed storing it as a temporary cookie (this sounds the most promising, actually).

11. posted by karma at 10:19 on January 26, 2002

you might want to get some inspiration from http://www.vcdn.org/Public/XMLRPC/ (a Javascript XML-RPC client)?. It sets up a http request itsself from javascript and then interpretes the answer. uses some activeX objects to do this though

12. posted by caster at 06:00 on January 27, 2002

bloody>nice>& >clean !
add a comment
Impressive self-sorting DHTML table by svendtofte.

1. posted by huphtur at 02:03 on December 30, 2001

warez!!!
add a comment
Include the following at the top of your Javascript:
  cookies = [];
  for (c in C=document.cookie.split('; '))
  {cookies[(cs=C[c].split('='))[0]]=unescape(cs[1]);}
Now you can access your cookies like this:
  alert(cookies['myCookie']);

1. posted by mijnkopthee.nl,bob,Bob at 09:38 on December 21, 2001

Smooth!
add a comment

pages: 1 2  next »