I was in Copenhagen last week for Reboot 8. I spoke at the conference but, for once, I wasn’t talking about JavaScript or Ajax. That didn’t stop me using a bit of JavaScript to help me deliver the talk.
Usually I don’t prepare what I’m going to say word for word. But this time was different. I had written a somewhat over-the-top treatise in praise of the hyperlink and I wanted to read it out. But I didn’t want to stand there reading from sheets of paper — I wanted more contact with the audience. What I needed was some kind of teleprompter.
I looked into using some ready-made software but, being of a stingy nature, I didn’t fancy forking over the license fee for a one-off presentation. So I wrote my own using HTML, CSS, and JavaScript.
The functionality is quite basic. A div
containing the text is constrained to the dimensions of the browser window. Then, by clicking on the text or pressing return, I can toggle the scrolling of the text. The speed of the scrolling can be increased by pressing ] and decreased by pressing [.
Initially the code was very rough’n’ready — I was using global variables to keep track of the scrolling (yuck!). Fortunately, the flight from London to Copenhagen was just long enough for me to whip the code into shape.
You can see it in action here. You can also download the code if you want to peruse the JavaScript or if you happen to have a speech you need to deliver.
My presentation ended up going very well. I read from a laptop on a high table in front of me, occasionally tapping the keyboard to adjust the speed. Meanwhile, I had another laptop on a chair which was connected to a projector. I controlled that one from my mobile phone and used it to display some minimal, tangential slides. I had to keep reminding myself not to confuse controls: I was fighting the urge to adjust the scrolling speed from the phone or move onto the next slide using the keyboard.
I managed to keep everything straight and the JavaScript teleprompter worked out quite well for me. I guess the actual scrolling speed will vary from machine to machine and I must admit, I haven’t tested it in many browsers. Still, for my particular needs, it did the job nicely.
Posted by Jeremy on Tuesday, June 6th, 2006 at 12:17pm
Comments
That’s great! I just got your DOM book yesterday and read about half of it. It’s great so far. I, like most average web designers, have used JavaScript on and off with a vague understanding of it, but enough to get it working. I decided to stop all that crap and just build a good foundation of knowledge on the subject. Your book is perfect for that. Thanks for writing it.
Sorry. Comments are closed.