This is my assessment of how Pinterest achieves it's unique modal look and how to duplicate it.
First and foremost, URL Link handling is server-side analyzed to see if the link is originating from the Pinterest site itself. That said, the Browsers URL Address Bar and History are dynamically created and not actually performed by the visitor.
To clarify: The address bar is not the actual place your at when a model experience is taking place! To prove this, click on a Pinterest object and when in modal view go to the Address Bar and at the end of that URL location place your mouse cursor there and then click enter. You will then redirect yourself to that location! For further verification that you never left the home page, view Net Tab in Firebug/Firefox or Network Tab in Chrome.
The following method is what Pinterest is doing when visiting the home page. Please view gingerly:
- Show Home Page.
- Wait for visitor to click on a Pinterest object.
- The clicked object has a unique webpage for direct access.
- The clicked object is not followed.
- The browser bar will populate itself with this clicked objects location, but your not actually there.
- The browser history will receive clicked location via JavaScrict or Server-Side processing.
- AJAX will load a piece of data (meat of modal via ID) from object's page. Verifiable via HTTPRequest.
- The clicked object on the main page has disappeared (This can be verified via Inspect Element).
- The AJAX process will place that piece of data in the center of the screen with a white overlay.
- Scrolling main page is disabled while AJAX "modal" data receives scroll events via
#zoomScroll
.
- Clicking modal background returns object to webpage and URL Address Bar is "visually" reverted.
To recreate the model effect Pinterest uses I would investigate different lightbox's that support HTML/iframed content. Reviewing the numbered steps above process will show how to achieve the desired look for your website.
A key step would be to set the lightbox to use all of the viewport, modifying the lightbox CSS rules if required to avoid any Close Button skin graphics and borders.
The lightbox can then use a single template file with a div
that's populated by AJAX. Said div
is horizontally centered in the viewport on a semi-transparent background. The iframe itself is transparent which would allow the underlying home page to show through.
Throw in some scrolling rules similar to Pinterest and you have a decent clone method to use.
As far as duplicating the Pinterest Webpage Layout, see this SO Answer.
To use custom Pinterest Button that is text-link, thumbnail, or combo of both, see this SO Answer.
For Data Scrape Pinterest process with jsFiddle tutorial, see this SO Answer.