I've got a custom dropdown similar to this <http://jsfiddle.net/hsmishka/54t32vfc/2/>.
How do I keep the absolutely positioned dropdown on the screen when resizing the window?
Something like right: 0; but only when it doesn't fit the window.

```
<div class="outer">
    <div class="dropdown">
        <ul>
            <li>item 1</li>
            <li>item 2</li>
        </ul>
    </div>
<div>
.outer {
    position: relative;
    margin: 100px;
    width: 400px;
    border: 1px solid green;
}

.dropdown {
    position: absolute;
    background: #EEE;
}

li {
    background: grey;
    height: 20px;
    width: 200px;
}

```