Settings

Theme

Facebook-Like Modal Library - Now supports mobile

github.com

25 points by mikesilvis 12 years ago · 8 comments

Reader

bzalasky 12 years ago

Facebook uses display: table for their modal so that they can center it vertically without worrying about JS (if the height is variable and/or unknown) or negative margins. As far as making it responsive, you just need to work on your styles a bit. Check out the image detail modal I made for Stipple.com (just click on an image in the feed). This implementation leans on Backbone.js a little bit, but for the most part, the markup and styles make up a majority of the library. The actual plugin just builds the dom elements, handles events, and provides callbacks.

Terretta 12 years ago

Thanks for sharing this.

On iPad, starting portrait and rotating landscape redraws but same size (too small). Starting landscape and rotating portrait tries to redraw same size (too large) but breaks layout, pushing text below image.

I feel as though portrait mode on iPad might look better with white box below the otherwise extremely tiny image.

Looks fantastic on desktop Safari.

  • mikesilvisOP 12 years ago

    Thanks, I haven't quiet figured out how to make it truly responsive. That's why when you rotate it gets out of whack.

    If you start with it in either orientation it should be fine though.

doughj3 12 years ago

Was confused for a moment, though this had something to do with "Likes" on Facebook. Just a small note, but should be Facebook-like, eh?

cmancini 12 years ago

I actually needed something exactly like this yesterday, and was having issues getting Bookstrap's modal to do what I wanted. Thanks!

  • mikesilvisOP 12 years ago

    Yeah let me know if you have any problems.

    Also if you do end up using it, then feel free to submit a PR to the readme to add your website.

jeffehobbs 12 years ago

Very nice!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection