Welcome to WebmasterWorld Guest from 54.162.136.26

Forum Moderators: open

Message Too Old, No Replies

Javascrip Help

Easter eggs on HTML pages?

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

Full Member

10+ Year Member

joined:July 8, 2001
posts:267
votes: 0


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)

Senior Member

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

joined:Sept 1, 2001
posts:4392
votes: 0


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)

Full Member

10+ Year Member

joined:July 8, 2001
posts:267
votes: 0


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)

Senior Member

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

joined:Feb 25, 2002
posts:3185
votes: 0


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)

Full Member

10+ Year Member

joined:July 8, 2001
posts:267
votes: 0


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)

Junior Member

10+ Year Member

joined:Mar 12, 2003
posts:161
votes: 0


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)

Full Member

10+ Year Member

joined:July 8, 2001
posts:267
votes: 0


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?

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members