Welcome to WebmasterWorld Guest from 54.166.222.116

Forum Moderators: open

Message Too Old, No Replies

Javascrip Help

Easter eggs on HTML pages?

     
8:32 pm on Mar 26, 2003 (gmt 0)

10+ Year Member



Is there anyway (javascript?) to have a certain keyboard command (CTRL+X) send the user to a differnt page, or make a picture popup?

Sort of like an easter egg on a webpage.

9:04 pm on Mar 26, 2003 (gmt 0)

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I think you could but it only would work in IE. I there are onKeyup and onKeypress events in IE which you could use. The problem would be that you would have to check every keypress to make it happen.
9:17 pm on Mar 26, 2003 (gmt 0)

10+ Year Member



Well its for a yearbook made in HTML, to be viewed off of a CDROM.

Were distributing IE with it, so IE will definetely be the browser.

How would i use these onKeypress events?

10:50 am on Mar 27, 2003 (gmt 0)

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You would need to capture the keypress of the two keys. For example, to capture a key:


function captureKey(e) {
var myChar;
e = window.event;
myChar = String.fromCharCode(e.keyCode);
}

document.onkeypress = captureKey;


Then you would need to test for the key press of both Ctrl and X - you may need to check if Control uses the onKeyup. Some keys use press and some keys use up. Also, Ctrl-X is a browser command for Cut... you may need to add a return false onto your code to negate this command.

7:59 pm on Mar 27, 2003 (gmt 0)

10+ Year Member



Hmmmm... A friend told me this would work, but seems to easy...

<a href="http://www.aardvarkind.com/" accesskey="a" target="_blank"></a>

It will open in a new window by pressiong alt+a followed by enter?

8:16 pm on Mar 27, 2003 (gmt 0)

10+ Year Member



Yep works in IE 6

Although you need to make sure that you don't use any of the letters defined to the menus

3:39 am on Mar 28, 2003 (gmt 0)

10+ Year Member



Well its going to be in fullscreen kiosk mode, so worrys there.

The thing i need now to do, is somehow hide the files/folders on the CD. Is there anyway to make them "hidden"? Any creative ideas?

 

Featured Threads

Hot Threads This Week

Hot Threads This Month