当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Fancybox - implementing backward and forward for iFrames

问题描述:

I'm using Fancybox to display webpages through an iFrame. Those webpages are like a little information network : they're calling each others via links, and user can circle through them.

I wanted to implement back et forth buttons : I did it by putting those buttons directly inside the displayed page, and working with the history (history.go(-1)) : that works, as long as the browser behave in the way they do with iFrames.

However, there's a problem : if the user click on the back button and is on the first page of his navigation, it will bring him back out of the website itself (as, out of the fancybox, it's a one-page website).

As for security purpose you cannot have access to the history and test it to avoid that, is there a way to find out if the user will get out of the domain if he does a step more ? Document.referent doesn't seem to work in the contexte of Fancybox and iFrames…

Thanks A LOT, I tried many (mainly stupid things), including a javascript session with window.name (see how desperate I am ?) !

分享给朋友:
您可能感兴趣的文章:
随机阅读: