I'm working on a site for an artist who didn't want to use flash to display his work (unique, right?), so I am using two iframes to display the work and the description with the navigation on the index page in a div. I know, I know, iFrames, but he wanted to have multiple pictures in a series change while the navigation and description below remained static and have each image on it's own page so it could be linked to individually if needed, so what else was I to do? ;)
Anyways, code and scripts can be seen here --> http://www.bradleyalan hart.com/index2.html - working/live examples with art are under "PAINTING > SELECTED WORKS" or "SCULPTURE"
The problem: What I want is to put a javascript redirect on all the pages that load in the iFrame "art", so that if someone links to a specific piece (ie through the "share on facebook" feature), when the link in the outside domain is clicked and they are brought to the specific piece that was linked (usually contained in an iFrame) the page will direct the browser to open the main page instead so you get the navigation, with the content of the iFrames on reload being the art and description of the piece initially linked.
So, in short, if a page meant to load in iFrame1 (lets call it "painting1.html ") is loaded outside of an iFrame I know I can have the browser recognize that and redirect with if(self.locatio n==top.location )self.location=
but what I don't know how to do is make that self.location= point to: loading the index2.html page with "painting1.html " loaded in iFrame1 (named "art") and a file named "painting1_info .html" loaded in iFrame2 (named "descriptio n").
Javascript isn't my forte, I work mainly in HTML/CSS and learn bits of javascript when I need them, but this one is seriously stumping me - I hope someone can help me out! I'm really stuck and because of the nature of this client's needs I don't have a lot of billable hours to spend testing for a solution. Plus, frankly, I think it's just beyond my depth. Any help would be GREATLY appreciated.
Anyways, code and scripts can be seen here --> http://www.bradleyalan hart.com/index2.html - working/live examples with art are under "PAINTING > SELECTED WORKS" or "SCULPTURE"
The problem: What I want is to put a javascript redirect on all the pages that load in the iFrame "art", so that if someone links to a specific piece (ie through the "share on facebook" feature), when the link in the outside domain is clicked and they are brought to the specific piece that was linked (usually contained in an iFrame) the page will direct the browser to open the main page instead so you get the navigation, with the content of the iFrames on reload being the art and description of the piece initially linked.
So, in short, if a page meant to load in iFrame1 (lets call it "painting1.html ") is loaded outside of an iFrame I know I can have the browser recognize that and redirect with if(self.locatio n==top.location )self.location=
but what I don't know how to do is make that self.location= point to: loading the index2.html page with "painting1.html " loaded in iFrame1 (named "art") and a file named "painting1_info .html" loaded in iFrame2 (named "descriptio n").
Javascript isn't my forte, I work mainly in HTML/CSS and learn bits of javascript when I need them, but this one is seriously stumping me - I hope someone can help me out! I'm really stuck and because of the nature of this client's needs I don't have a lot of billable hours to spend testing for a solution. Plus, frankly, I think it's just beyond my depth. Any help would be GREATLY appreciated.
Comment