homepage Welcome to WebmasterWorld Guest from 54.226.180.223
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
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?
kingkelly




msg:1490049
 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.

 

txbakers




msg:1490050
 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.

kingkelly




msg:1490051
 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?

BlobFisk




msg:1490052
 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.

kingkelly




msg:1490053
 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?

davemarks




msg:1490054
 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

kingkelly




msg:1490055
 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