I want to hide the thing that will promote it once you've wandered inside.
May 19, 2012 1:24 PM   Subscribe

Iframes and CSS insertion. Help or a better idea?

So I'm making this map timeline that is slowly crystallizing into something beautiful. It Fancyboxes several hundred entries into an iframe on mouseovers. So far, so good.
My issue is that I know people will link to and stumble across the various independent entries and I want those entries to link back to the original map (so they can see that it's part of a big beautiful thing), but I don't want to interfere with them when they're viewed properly within the iframe.
So we have a link in the entry template with a link back to the map in a div with class siteinfo. Is there a way we can tell it to hide siteinfo only when it is viewed within the iframed map? Or is there a smarter way to do this? Suggestions that I convert over to some kind of ajax or other database related solution will be met with blank stares and silence (you can show yourself out).
Otherwise, it is going to be awesome when it is done.
posted by history is a weapon to Computers & Internet (3 answers total) 3 users marked this as a favorite
 
You can check it window.top==window.self in JavaScript, which will return true if the user is just viewing the page, and false if the user is viewing the timeline.
posted by hobgadling at 1:46 PM on May 19, 2012


Best answer: I'm not sure I fully understand the question, but:

if (window == window.parent) {
// I'm not in an iframe!
showLinkElement();
}
posted by tylerkaraszewski at 1:49 PM on May 19, 2012


Response by poster: Thank you.
posted by history is a weapon at 2:08 PM on June 11, 2012


« Older I'm lost!   |   The dress must be out there. Newer »
This thread is closed to new comments.