homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Javascrip Help
Easter eggs on HTML pages?

 8:32 pm on Mar 26, 2003 (gmt 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)

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)

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)

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)

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)

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)

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?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved