You are here

Javascript Message Window

I'm working on a popup message window for my uncle's game Dark Expanse. The idea is that clicking a star on the star map will pop up a small "e-mail" window displaying messages related to that star. The code is a work in progress, but I just hit a milestone and wanted to upload it quick.

At this point, the data is loaded using a $.getJSON call, displayed in the message selector, and clicking a message loads it into the display area. The last few hours have been spent integrating a scrollbar solution so that the scrollbars are always a fixed width, instead of dealing with browser and UI inconsistencies. I used Tiny Scrollbar created by Maarten Baijs because it was simple, straightforward, and very lightweight. I've also handled up and down arrow keystrokes, and set it so that the scrollbar updates when the newly selected message is outside of the viewport. I'm not sure if anyone else will find this code useful, and I'm not even sure what to call it, but perhaps someone else needs something similar.

Here it is

Topic: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.