The Trolley to Yesterday, by John Bellairs (1989). This is the sixth book in a series about Johnny Dixon and the eccentric professor who is his neighbor, but it can stand alone.
So the basic premise of the plot is that the professor has a time travelling trolley in the basement of his house, and has been using it to go back in time to watch the build up to the conquest of Constantinople in 1453. And Johnny and his friend Fergie intrude themselves into the trolley rides to the past.
Now, I myself would be surprised to find a neighbor had a time-travelling trolley, and had used it not only to go back to 1453, but also to ancient Egypt from whence he had returned with a minor Egyptian god nicknamed Brewster but Johnny and Fergie take it in their stride. And it is good that they are able to accept the impossible, because back in time in Constantinople they get to experience--
--a boatload of Knights Templar ghosts
--a magical device, given to them by the ghost Templars, that acts as a magical transporter
--the original inventor of the time trolley, who for some time thinks he's a Venetian admiral
--a talking statue that makes them answer Roman trivia questions; if they can't, their stuck in the city's subterranean aqueduct forever
--Brewster's magical abilities
And the more mundane efforts of the professor to save the Christians who have taken refuge in the Hagia Sophia pale by comparison to all these divertissements.
What there is, clearly, is lots of story, and a lot of tense excitement as things get worse and worse for the time travelers and they are separated from their trolley ride home to the future by more and more people who want to kill them (both Christians inquisitors and Muslim invaders). It was kind of like a time-travelling Mad Libs story. As I read, I didn't bother to ask "what is happening?" because there it all was, happening away, and though impossible and rather insane, it all followed a fairly linear path. I did, however, ask "why are they so blasé about all this magic?" but I guess that's what a time-travelling trolley will do to a person.
I also asked the rather more interesting question "how is this book different from books published today?" and the main thing that struck me (apart from the fact that it was shorter) is that there is very little tension between the characters--there's no important emotional story arc, which I feel most middle grade fantasy books of today at least aspire to. That's not to say there's no emotion--the friendship and not always amiable interactions between the two boys were just fine, and the emotional desperation of the people inside the besieged city was believably intense. It's just that the same things would have happened to any old kids just about, and character development wasn't the point at all.
Oddly, Booklist called this one "perfect for the pre-Stephen King set" and I am really having trouble wrapping my head around this...there is no similarity, no sense that the Templar ghosts of today will become the dark horror of tomorrow. It is just as perfect for the pre-Hemmingway set.
Publisher's Weekly said something I found odd as well-- "Bellairs's vision of Constantinople is as spooky as it is exotic" and I do not know at all what they mean by "exotic" because we barely see the place, unless they mean "not 20th century New York" which isn't saying much, or possibly exotic as in "having magical talking statues guarding the aqueduct" which is saying more. It is not exotic in the sense of providing a rich, detailed description of life in a different culture.
However, not all educational opportunities are lost--at least the young reader will know that Constantinople fell, and have a confused but vivid sense of how that day in history played out.
I myself have no desire to read any more John Bellairs, but I can see how the kids of 1989 who would have loved Harry Potter and Percy Jackson would have enjoyed his books. And I can imagine, though with a tad more effort, kids of today enjoying this book, because it really was rather fun.
(fans of Edward Gorey will have noticed that he did the cover art; here's a post about the book's art at the Goreyana blog which has just distracted me more than somewhat.)