Thursday, October 20, 2011

A Duet With Siri (iPhone 4s Song)

So, I was going to make a video of Siri reacting to funny commands like "I love you" and "What's your favorite color?" Then I saw this video and it's easily 10 times cooler than anything I could do. So here's a video by Jonathan Mann showing off the sassier side of Siri.



I honestly still can't decide if Siri is genuinely useful or if it's just going to provide great entertainment and never ending memes. In the mean time, here are some particularly sassy replies:

Q: Can you tell me a joke?
A: I can't, I always forget the punch line.

Q: Beam me up
A: Energizing...
A: Sorry Captain, your TriCorder is in Airplane Mode.
A: OK. Stand still.

Q: How much wood would a woodchuck chuck if a woodchuck could chuck wood?
A: It depends on whether you are talking about African or European wood.

Q: What is your favorite color?
A: My favorite color is... well, I don't know how to say it in your language. It's sort of greenish, but with more dimensions.

Q: Siri, what are you wearing?
A: Aluminosilicate glass and stainless steel. Nice, huh?

Q: What is the best phone?
A: Wait... there are other phones?
A: The one you're holding

Q: Knock knock
A: Knock knock. Who's there? James. James who? James, I don't do knock-knock jokes.

Tuesday, October 18, 2011

28 Years Old

Visiting CA for Lisa's birthday
For some reason, 28 doesn't sound as scary as 27 did. I don't have any real reason for it - it just sounds nicer.

First off, thank you everyone for all of the birthday wishes! I really do appreciate it. Today should be a relaxing day. I don't have anything planned and so today gets to be a day of hanging out. Now for a couple pictures of my past year and then I'm off to enjoy the day.

Christmas Tree Hunting

Trying on some PJs for a Man-Jama party.

Visiting Singapore

Earning my blue belt in Jiu Jitsu

Mustache March!

Corvallis Half-Marathon

Visiting India

In Ohio for my best friend's wedding

Dressed up for Brian's wedding

Running to the beach with Vinnie

Watching hot air balloons lift-off

Flying in an airplane as James "TC" Furlo (T= Top Gun. C = Macaroni & Cheese; Or Top Cheese)

Wednesday, October 12, 2011

Storage Wars: Crystal Lake Public Storage

Ever seen Storage Wars on A&E? It's streaming on Netflix if you want to watch it. It turns out that similar storage auctions are going on right here in the Corvallis/Albany area. I got invited to tag along with a friend yesterday and it was a hoot.


There was a single locker going up at this place - a 10' x 10'. The manager came in with the cutters and opened it up. What did we see? Stuff. And lots of it. If I had to guess, at one time it was all in an apartment, and everything was jammed in here all the way to the very top.

We were given 5 minutes to look - no going inside, no touching - and then bidding began.


This auction was a verbal one. The other style is silent - you write down your bid, then they open them all up and choose the highest. For this one, the manager stood at the door calling out numbers while the rest of us stood back calling out amounts. He didn't talk super fast like the guy on the TV show, but I could still feel the excitement as people started bidding.


From what we could tell, there were a couple items potentially worth something, but most of it was just household junk. Still, you never know - there could be that rare multi-thousand dollar find lurking in the back! ha ha.

In the end, my friend won the bidding. Super exciting! He threw on his lock, paid the manager and filled out the paperwork. He now has until the end of this weekend to get it all out.


We spent a few minutes poking around to see if there actually was anything of value. Thanks to smart phones, we were able to look up a couple items on eBay to see what going rates are. This sub woofer shown below could probably go for $50-$70 if it's in working condition. The telescope, turned out to not be worth as much as he thought, only $35, but that's the gamble.



It was fun getting to tag along and watch the process. To be successful, even as a hobbyist, you need a few things:

  1. The cash to pay if you win
  2. The transportation and storage if you win (unless you want to keep renting the unit...)
  3. An eye for the value of a large cross section of items
  4. Patience to list and sell everything

Will I ever get into it? I'm not sure yet. Part of it depends on Jessi. :) Something like this would never replace my current job. So it would always be just a hobby.

My dad recommends I at least bid a couple times and see what it feels like to win, on a smaller unit of course. He also said I should check out a construction vehicle auction because the bids are in the thousands instead of the hundreds. Now that would be a rush!

Monday, October 10, 2011

Duplex Painted - A Business vs. Self-Employment


A little bit ago I quickly noted that we were getting our duplex painted. Well, it's done! See above for what it looks like now. See below for what it used to look like.


What do you think? I think it looks MUCH better - especially the huge wall in the front.

In my previous post I talked about our "Great Experiment". Basically, which hurts more: putting in a ton of work on a project (physical/time pain), or writing a big check (financial pain)? The main reason behind this experiment is a general lack of both (time & money). If we had copious amounts of either one, the choice would be easy.

Also playing into our decision is our desire to be business owners. As a Robert Kiyosaki fan (see Cashflow Quadrant), I make a distinction between being self-employed and owning a business, and I want to own a business. Jim Collins makes a good analogy in Built To Last: You can either build a clock, or say the time out loud. Both have the same result - reporting the time - but one is building a system (business) while the other is a job (self-employed).

We want our real estate activities to be a business; a system where we hire excellent people to help with the activities. Hiring people to paint our place and install windows is an example of us treating our duplex like a business. We also have dreams of hiring business development people, maintenance staff, and tenant service representatives.

The trick to being a successful business is to provide enough value to our customers that we can actually afford to hire others. This is where Jessi and I get into long conversations about competitive advantages and value propositions. I love it; Jessi just wants it to be profitable without taking up all her time.

So, eventually we want to figure ways to only be writing checks. We're actively figuring out ways to do that. However, I think for the short-term, we'll have to use our time for most projects. Thankfully there's only one large project left (new windows on our side), and it'll be at least a year before we even think about attempting it.

Thursday, October 06, 2011

3rd Annual Parry-Furlo Camping Trip: Yurtin' For Certain'!


Every year we go camping with the Parrys, it gets better. Our first year we went to Sandbeach and listened to ATVs all day long. Our second year we went to Beverly Beach. We were too close to 101, but right next to the beach. This year we went to Cape Lookout State Park. We were once again right next to the beach and so that was what we heard all night - the ocean.

Furthermore, we stayed in a yurt. It's a 20' diameter circle (it's in the background of the top picture). With a table, a couple chairs, a bunk bed, a futon, and a heater. So even though there was the threat of rain this weekend, we were going to stay dry and warm.

It turns out though, that the weather was amazing! It was sunny and warm on Saturday, which made for a perfect beach day. Vinnie loved the beach too. He ran around like a crazy dog - totally tiring himself out. Awesome! Here's a picture of Grace and Ethan evaluating all the shells they found at the beach.


There were also a bunch of gnarly tree all around the campsite which were perfect for Grace and Ethan to climb. I actually think they spent more time in a tree than on the ground.

On the way home, we stopped at the Tillamook Cheese Factory for some ice cream. I don't know why, but for some reason the ice cream tastes extra delicious here.


It was a great trip and I think we're going to try and go back again next year. We just need to make sure we're ready to pull the trigger 9 months in advance to get a yurt again. Finally, there are many more photos (and much higher quality photos too) on The Parry Family Chronicles Blog.

Tuesday, October 04, 2011

Flying In An Airplane Video

As a follow-up to yesterday's post about flying in an airplane, here's a video of the take-off and landing. There isn't much to listen to other than the hum of the engine and propeller, but watching the landing is fun. This video is compliments of Scott, who's riding in the back seat. I'm sitting on the right.


Monday, October 03, 2011

Flying In An Airplane


It's time to tick another goal off of my 2011 Goals! I've been doing pretty well so far. I got my Blue Belt in Jiu Jitsu. I also ran my first Half-Marathon. This goal requires a little bit of explaining. First, here's what I originally wrote:
5) Fly in a Fighter Jet (I don't know why, but I feel the need to capitalize Fighter Jet)
This is definitely the most exciting and most difficult goal I have. I'm not even 100% sure how I'm going to accomplish this goal, and I even contemplated leaving it off. Then I figured at the very least I'd have some fun stories to tell. So, my plan of action is to start asking if people know someone (who knows someone?) that might be able to do something in the way of riding in a Fighter Jet. I also need to decide how much money I'm willing to spend to accomplish this goal.

After asking around a bunch I learned that this goal is pretty much impossible to accomplish in today's society. If I pursued this goal before September 11, 2001 I actually would have stood a pretty good chance. However, since then all such rides have been almost 100% banned. Bummer.

So, I decided to modify this goal to something more reasonable. I wanted to fly a small airplane. Even if I only got to man the controls for 30 seconds, that would be enough of a thrill.

On Friday I got to do just that. It all started at a Willamette career event. I was supposed to be doing quick mock interviews for students to help them gear up for the year ahead. The first person sat down, named Scott, and we began talking. I noticed him wearing an Air BP shirt. Interesting. I glanced at his resume and saw he had an internship with Air BP. More interesting. So I asked the logical question, "Did you get to fly in a small airplane during your internship?" The answer was no, but his father, who lives in Corvallis, had his pilot's licenses, so he got to go flying a lot. Mega interesting!

At this point in time I ditched the mock interview process and straight up asked about getting a ride. Scott said he had to check with his father - fair enough. After some emails back and forth, and one false start due to a mechanical issue, we got in the air last Friday. Boom!

We flew around Corvallis, Philomath and Albany for about an hour. At one point, I even got to man the controls - what a blast! The city sure does look different when up in the air.

Time for a graphical tour of the area.


Here I am wearing my headset. Very official looking. ha ha. I've been working with my dad to create a call sign. So far, the front runner is "TC". T stands for Top from Top Gun (the best movie of all time). The C stands for Cheese from Macaroni and Cheese (the best food of all time).


Reser Stadium. Home of the Oregon State Beavers.


Our church - Northwest Hills Community Church. Not much happening on a Friday afternoon.


HP's Corvallis Site. It really is a large place. I can see why it's a big deal to the community. I think next summer Jessi and I should try to float down that river.


See that blue house with the white-ish roof in the center just above the field? That's our house.


Many thanks to Scott and his father for helping me accomplish one of my goals this year. It was very nice of them to allow me to ride along. Thank you!

Friday, September 30, 2011

Painting The Outside Of Our Duplex


Jessi and I are in the middle of getting our duplex painted. Pretty exciting and badly needed. We should have done it last summer, but you can only spend so much money each year...

Anyways, we are in the middle of a "Great Experiment":

Last summer we did 100% everything ourselves. It was a TON of time. This summer we hired out all our big projects. It was a TON of money.

The question we're trying to answer is "What hurts more?" Spending a TON of time on projects... really a slow bleed of energy that adds up over time. Or, getting it all over at once by writing a HUGE check.

We'll let you know in a bit (with before and after painting pictures).

Monday, September 26, 2011

A. Lincoln: A Biography [Book Review]

This last week I finished listening to A. Lincoln: A Biography by Ronald White. This particular audiobook lasted 40 hours. This is the type of book I never would have finished if I was forced to read it with my eyes.

Again, I enjoy listening while doing relatively think-free activities: driving, mowing the lawn, running, and washing dishes. You'd be amazed at how much you can listen to when taking advantage of these opportunities. (Jeez, I can be positive to a fault...). A couple thoughts/tips about listening to audiobooks:

  • Even if I'm only going on a 10 minute drive, I'll listen. Some people like to wait for big chunks of time, but I find that I listen frequently enough, that small chunks of time work just fine. Plus, 10-20 minutes here and there start to add up.
  • My iPhone has a cool "repeat the last 30 seconds" feature which I tap twice when I start listening. That gives me a good rolling start into the new section.
  • I got an AM/FM transmitter so I can listen through the speakers in my car instead of driving around with headphones on.
  • I've heard the iPhone's audible app is pretty good. Though, for whatever reason, I've stayed with the built in iPod app. It works great for me.

Wait. What was the point of this post? Oh yeah.

This biography on Lincoln is awesome. It starts with his parents and goes all the way through his death. You get to see is character develop as a youth. Then witness his presidential election win. The way he got nominated was brilliant too. It was a similar "delegates set-up" as today, but they kept voting round after round after round until someone emerges with the majority of delegate votes.

Lincoln asked each delegate to vote for him second if their favorite candidate clearly wasn't going to win. So, at the beginning Lincoln was way behind. Then, as others dropped out, Lincoln started gathering those votes. As more dropped, Lincoln got more votes. Eventually, his win became inevitable. Brilliant.

As you probably remember, it was during his presidency that the US had its civil war. This book goes into great detail of these events from Lincoln's perspective. For example, Lincoln originally asked Robert E. Lee to lead the Union army. Lee said he would think about it, and then a week later was announced as the leader of the Confederate army. For almost 3 years Lincoln struggled to find a commander who was even close to Lee's genius on the battle field. If it wasn't for the shear number of people the Union army recruited, the Union would not of won.

Another amazing aspect was listening to his speeches and his logic. Lincoln really had an excellent grasp on America and what it represented. It felt like Lincoln was really coming into his own those last couple of years too. When he died, the civil war had just been won and he has just been re-elected. Given how delicately and masterfully he handled the political landscape during the war, it would have been amazing to see what he could have accomplished the next four years during the transition away from slavery.

If you're into American history, this book is definitely worth reading.

Thursday, September 22, 2011

Put Cash In Your Car's Glove Box... Just In Case



Here's a LifeHacker.com worthy tip. Credit goes to my friend Julie for sharing it with me the day we went to watch a movie and their credit card machine was busted:

Put a small amount of cash in your car's glove box... just in case. Just in case the movie's credit card machine breaks. Just in case you find yourself unexpectedly crossing a toll bridge. Basically, for those times you need cash because for whatever reason, the dream of a cashless society came crashing down on you.

I put $11 in each vehicle. One $5 bill. Five $1 bills. And four quarters. Enough to cover 99% of the situations I find myself in, but not enough to worry about it being stolen (but seriously, don't steal from me, friends).

When I use the cash, I leave myself a note on RememberTheMilk.com to refresh it the next time I visit the bank.

There you go. A simple tip to get you out of a plastic pinch.

Monday, September 19, 2011

My Sister's 21st Birthday Party


This weekend Jessi and I drove down to California for my sister's, Lisa, 21st birthday party. Yeah, it was a long drive, but it was worth it. We left Thursday afternoon, arrived Friday morning, and return Sunday afternoon/evening. We really enjoyed seeing everyone and just "getting away" for a bit. Here's some pictures of the weekend:


Friday afternoon, Jessi got to ride on a motorcycle for the first time. She said she really liked taking the turns. It'll probably be a while (if ever) before we think about getting a motorcycle... especially while living in rainy Oregon.



Saturday morning drank mimosas with sour dough pancakes. Super fun!


Saturday afternoon my Dad, brother and I did some shopping around town. We made sure to spend some time drooling in the Lego Store.


Lisa made an upside down tired birthday cake. Each tier was a different flavor. It was extremely delicious! Those are M&M's on the outside of the cake. Lisa has some true baking skills.


The party was at Nono's Pizza in Los Gatos. Basically, it's some of the best pizza in the world (yeah, I just said that). The atmosphere was awesome, the weather was perfect, seeing family was a blast.





Sunday morning before we left, Jessi made sure I got a photo of Vinnie standing with a wooden wiener dog made by my dad when he was a kid. Not shown in this photo is Boots, Lisa's cat. Boot's probably had the worst weekend of everyone. She was NOT a fan of an energetic puppy sniffing everything. She spent the weekend standing rigid in a corner glaring at Vinnie. Any time he got close to her, she would start making this intimidating growling/howling noise.


And finally, driving back home. It was warm during parts of the ride, but Vinnie was a trooper. Of course, he did have the whole back to himself with blanks and pillows. What a spoiled little doggie.


Thursday, September 15, 2011

How To Boost Productivity

academicproductivity.com
I recently listened to a call from someone named Andrew Cass. I don't know much about him, other than what I found on his website, but he had some great insights into being more productive. I like to think I'm a fairly productive person and wanted to share his thoughts, and some of the things I do.

Do NOT Multi-Task
This one took me a while to figure out. I used to have multiple desktop widgets, multiple websites open, a movie playing on my phone, Outlook open, AND a work project I was "working on". In retrospect, it's hard to believe I actually got any work done. Now I've uninstalled my widgets, I no longer have my browser persistently open, I don't watch movies while working. I don't even have Outlook open all the time. When I work, that's ALL I do. When it's time to relax/play, that's ALL I do. There's a clean break.

Batch Tasks
I implied it earlier, but I wanted specifically call this out. Instead of randomly jumping between tasks, put items together that make sense. For example, when I check my personal email, I also read the latest news, check Facebook/Twitter, play with Vinnie. Those are all fun items. As a result, I check my email much less, but I give it more concentrated attention. I've written earlier how that's enabled me to consistently reach a zero inbox. Then I move on to the next set of tasks.

Part of being able to accomplish this is realizing that the world doesn't need your instant response. I learned this lesson during my media fast. People are OK with waiting to get a reply. News doesn't have to be read instantly (or at all - it's OK to miss things). Here's what you do: cut out everything. Then, only add it back if you real feel like it's missing. Here's a crazy idea: remove all the bookmarks in your browser. Then only add back the ones you use regularly. I did that with my RSS reader and it was amazing. I also do this with physical things as part of my whole own less stuff/spend on experiences philosophy. I move items into our garage. If it doesn't come back out after a year, I get rid of it after taking a picture for my computer's screensaver.

Become A Calendar and To-Do List Master
One of the big things I do is put EVERY appointment/meeting in my calendar. I actually tell my wife that if she doesn't put it on my calendar, I'm not showing up. We use Google Calendar, so we can easily add/edit/view our meetings from any device. This means I don't have to memorize anything.

I'm also a To-Do list master. David Allen, author of Getting Things Done, would be proud. I personally use RememberTheMilk.com because it's clean, flexible and available on any device. Any system that you can use consistently works. Before I do a task, I write it down. I have 5 types of lists, and 3 ways to sort them:

  1. A general inbox for items
  2. Blog post ideas
  3. Regular repeating tasks (examples: Mow the lawn every other week, feed Vinnie daily, a monthly financial summary, write annual Christmas letter, pay quarterly jiu jitsu dues).
  4. Projects with multiple tasks (my way of solving RTM's 1 short coming of no sub-tasks)
  5. Shelved items - things I want to remember, but it would be OK if I never get to it.
The 3 additional ways I sort them:
  1. Today: I live here. Things I want to do today
  2. Tomorrow: For when I'm planning my next day in the evening
  3. Week: So I can see what's coming up. I use this less often, but find it helpful.

Again, I don't have to memorize anything.

What this means is that when I'm working, I'm not subconsciously trying to remember other things I have to do. This means I'm more productive. I believe the term is "mind like water".

Learn To Say "NO"
Honestly, this is one I'm still learning to master. Through various motivational videos/articles it's clear that productivity (and more generally, success) is also based on narrowing your focus. Jessi harasses me all the time because I want to do everything - and she's right for doing it.

In Malcolm Gladwell's book Outliers he talks about practicing something for 10,000 hours (my full review). In order to become a master at something, it takes about 10,000 of concentrated practice. Not only does this explain why I never became fluent in Spanish, but it also has a hidden implication in it: In order to reach that level of practice, you have to say "no" to 10,000 other hours worth of activities. 10,000 hours is a LOT of time. That means being able to say "no" to a LOT of items.

I wish I had some tips to saying "no", but it's honestly hard to do. One thing Jessi and I do while we set our annual goals, is literally draw out everything we're involved in. No joke - it looks like a colorful mind map that you probably used when writing papers in school. Then we step back and take a look at everything as a whole. Then we can decide where to increase/decrease our activity. If you're like me, you'll still struggle to eliminate items, but it's at least a way to wrap your head around your life.


So there it is.

  • Stop multi-tasking
  • Batch items together to streamline your workflow
  • Become a calendar and to-do list master
  • Learn to say "no"
That's at least a start. With practice and discipline you can start to be more productive.

Friday, September 09, 2011

How To Calculate Browser Height And Display An In-Page-Pop-Up [tutorial]


While recently working on a website I wanted to add an in-page-pop-up whenever a user clicked a feedback button. It became slightly tricky because there were some pages where the content was longer than the browser height (i.e. you had to scroll), and other times where the content was shorter than the browser's height. I did some online hunting, but never found a great solution. Then, I had my own little insight: use a hidden div at the bottom of my content. I can calculate where it is, then compare it to the height of my browser. Whichever is longer, that's the one I'll use.

So, here's a tutorial on how to make a simple in-page-pop-up with a semi-transparent backdrop. You get lots out of this tutorial:
  • How to calculate your browser height using javascript
  • How to compare your browser height to your content's length
  • How to make a div transparent using CSS
  • I also throw in some rounded corners using CSS
  • How to use the onclick="" mouse action in javascript
  • A simple javascript "for" loop
  • How to insert new content into an element using javascript's innerHTML function.
  • How to make your popup display, and disappear

First, here's all the code, then I'll break it down. You can save this as your own file and mess with it. You can also see it working here.

======================

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <head>
      <style>
         *{margin:0; padding:0}

         html, body {
            margin:0px;
            padding:0px;
            background:#fff;
            font-family:arial,sans-serif;
            font-size:.95em;
            text-align:left;
            overflow:auto;
         }

         #backdrop{
            position:absolute;
            top:0px;
            left:0px;
            width:100%;
            height:0px;
            background:#333;
            opacity:0.4;
            filter:alpha(opacity=40);
            }

         #popup-wrapper{
            position:fixed;
            top:150px;
            left:0px;
            width:100%;
            }

         #popup{
            background:#fff;
            width:500px;
            margin:auto;
            padding:.5em;
            -moz-border-radius:5px;
            -webkit-border-radius:5px;
            border-radius:5px;
            }

         #bottomofcontent{
            display:hidden;
            }
      </style>
   </head>

   <body>
      <div id="maincontent">
         <p>All of your normal content here. Can be longer or shorter than the browser window.</p>
         <p><a href="javascript:void(0)" onclick="addmoretext()">Add More Text!</a></p>
         <p id="moretext"></p>
         <p><a href="javascript:void(0)" onclick="displaypopup()">Show Popup!</a></p>
      </div>
      <div id="backdrop" style="display:none"></div>
      <div id="popup-wrapper" style="display:none">
          <div id="popup" >
            <p>Put new things in here.</p>
            <p><a href="javascript:void(0)" onclick="hidepopup()">Close me!</a></p>
         </div>
      </div>
      <div id="bottomofcontent"></div>
   </body>

   <script type="text/javascript" language="javascript">
      function addmoretext(){
         var newtext = "";
         for(i=1; i <= 100; i++){
            newtext = newtext + "line " + i + "<br />";
         }
         document.getElementById('moretext').innerHTML = newtext;
      }

      function displaypopup(){
         var totalheight = heightcalc();
         document.getElementById('backdrop').style.height = totalheight + "px";
         document.getElementById('backdrop').style.display = "block";
         document.getElementById('popup-wrapper').style.display = "block";
      }

      function hidepopup(){
         document.getElementById('popup-wrapper').style.display = "none";
         document.getElementById('backdrop').style.display = "none";
      }

      function heightcalc(){
         // Calculate the size
         var myHeight = 0;
         var myContent = document.getElementById('bottomofcontent').offsetTop;
         if( typeof( window.innerWidth ) == 'number' ) {
            myHeight = window.innerHeight;
         } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            myHeight = document.documentElement.clientHeight;
         } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            myHeight = document.body.clientHeight;
         }
         if( myHeight > myContent ){
            return myHeight; 
         } else{
            return myContent;
         }
      }
   </script>

</html>

======================

I'm going to start with the body:

<body>
      <div id="maincontent">
         <p>All of your normal content here. Can be longer or shorter than the browser window.</p>
         <p><a href="javascript:void(0)" onclick="addmoretext()">Add More Text!</a></p>
         <p id="moretext"></p>
         <p><a href="javascript:void(0)" onclick="displaypopup()">Show Popup!</a></p>
      </div>
      <div id="backdrop" style="display:none"></div>
      <div id="popup-wrapper" style="display:none">
          <div id="popup" >
            <p>Put new things in here.</p>
            <p><a href="javascript:void(0)" onclick="hidepopup()">Close me!</a></p>
         </div>
      </div>
      <div id="bottomofcontent"></div>
   </body>

  • First, we have our main content. This can be anything.
  • I added a little text, and a couple links which when clicked will run the function called "addmoretext" or "displaypopup". Hopefully it's obvious what each of these functions do. We'll get to the actual javascript in a bit.
  • Then we have our "backdrop" and "popup-wrapper". The display needs to be set to "none". Also, it has to be as an inline style="" modifier. Otherwise javascript won't make it appear. So, these two containers are there, but are not displayed yet.
  • Then the actual pop-up div which will display whatever you want the pop-up to be.
  • Why have two separate divs ("backdrop" and "popup-wrapper")? Because the backdrop is going to be semi-transparent. If the popup-wrapper was inside the backdrop, it too would be semi-transparent. In this case, we want it to be fully opaque.
  • Inside the "popup-wrapper" is the actual "popup". The "popup" has some text and then a link which will close/hide it.
  • Finally, we have the "bottomofcontent" div. This should be right next to the "body" tag. The very end of all your content.


Here's the CSS. I'll make a comment about each one as we go:

         *{margin:0; padding:0}
// Just a standard setting I use to make all browsers look the same

         html, body {
            margin:0px;
            padding:0px;
            background:#fff;
            font-family:arial,sans-serif;
            font-size:.95em;
            text-align:left;
            overflow:auto;
         }
// Another standard I use to make sure everything looks the way I would expect.

         #backdrop{
            position:absolute;
            top:0px;
            left:0px;
            width:100%;
            height:0px;
            background:#333;
            opacity:0.4;
            filter:alpha(opacity=40);
            }
// I position it at the top. It stretches 100% of the browser width. Height = 0 because later we'll calculate what it should be. Why not just use 100% for the height? We could, but if the content is longer than the browser window, it won't cover everything.

         #popup-wrapper{
            position:fixed;
            top:150px;
            left:0px;
            width:100%;
            }
// Also fixed to the top, but brought down a little. Remember, this one and "backdrop" are not displayed when the page loads. I choose to use "fixed" for the position so the box will always display in the same place in the browser no matter how far the user scrolls.

         #popup{
            background:#fff;
            width:500px;
            margin:auto;
            padding:.5em;
            -moz-border-radius:5px;
            -webkit-border-radius:5px;
            border-radius:5px;
            }
// The popup. "margin:auto"centers it on the page. Those 3 radius settings give it round corners. You could set the width to a percent if you wanted. You can also set borders, change colors, whatever. It's a regular div. Notice this one isn't hidden. It doesn't have to be because it's parent div ("popup-wrapper") is hidden.

         #bottomofcontent{
            display:hidden;
            }
// Notice I put "display:hidden" instead of "display:none". If it was display:none, the browser wouldn't know it's position. Visually, it's the same as none, but the browser interprets it differently.



OK. Let's look at the javascript. Again, I'll make comments along the way.

  function addmoretext(){
         var newtext = "";
         for(i=1; i <= 100; i++){
            newtext = newtext + "line " + i + "<br />";
         }
         document.getElementById('moretext').innerHTML = newtext;
      }
// This is really just for the example. I use a for loop to create 100 new lines of text. That should be enough for the content to be longer than the browser. I then fill my "p" element called "moretext" with this new text. innerHTML does what the name implies: it fills inside the element which whatever you put.

      function displaypopup(){
         var totalheight = heightcalc();
         document.getElementById('backdrop').style.height = totalheight + "px";
         document.getElementById('backdrop').style.display = "block";
         document.getElementById('popup-wrapper').style.display = "block";
      }
// First we get the height (wait for it... it's coming). Then we apply that height to "backdrop". Then we display "backdrop" and "popup-wrapper". To display something, we either use "block" or "inline". Since these are div elements, they are block elements, so we use block.

      function hidepopup(){
         document.getElementById('popup-wrapper').style.display = "none";
         document.getElementById('backdrop').style.display = "none";
      }
// When it's time to hide the pop-up, just use .display = "none". Notice, I reversed the order in which they're hidden from when they were displayed. Computers are typically fast enough that the order doesn't matter too much, but I feel good about knowing the disappear in an order than makes sense to me. You could also set the height of "backdrop" to zero, but there's no real reason to.

      function heightcalc(){
         // Calculate the size
         var myHeight = 0;
         var myContent = document.getElementById('bottomofcontent').offsetTop;
         if( typeof( window.innerWidth ) == 'number' ) {
            myHeight = window.innerHeight;
         } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            myHeight = document.documentElement.clientHeight;
         } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            myHeight = document.body.clientHeight;
         }
         if( myHeight > myContent ){
            return myHeight; 
         } else{
            return myContent;
         }
      }
// here's the height calculation. First we set myHeight to 0 as a placeholder. The we get the "bottomofcontent" by using offsetTop function. Now, different browsers calculate browser heights differently. The set of if/elseif's goes through each browser type. When it finds the right one, it sets myHeight to the browser height. Then we have one final if statement that compares myHeight to myContent. Whichever is longer gets returned. Boom.

So that's how you make a simple in-page-pop-up in a website. You can make it more complicated using ajax and fill the pop-up with new content pulled off the server, but that's for another time. Hopefully there was at lease one tidbit that was helpful.