call Fancybox in parent from iframe

后端 未结 3 1458
暗喜
暗喜 2020-11-22 16:53

I have 2 pages, my index.html and social.html. I cleaned out my index and left only the jquery code need for fancybox What I am trying to do is to have images inside social.

3条回答
  •  死守一世寂寞
    2020-11-22 17:20

    Ive encounter this problem before and was able to find a solution. Here is what iv done. in my iframe page i called the parent window with the href e.g. onClick="callMe('www.google.com')" or if pics "/images/pics.png" and call this script in my parent page

     
    

    in my parent html we right a decoy link (this one is from the example on load fancybox)

     
     
     
    

    You can download a working example here.. https://docs.google.com/file/d/0B1TI7BdxGAbvYzBiZjNiMDYtNjY4ZS00NDczLWE2YjQtODNlMjU4YTNjYWI0/edit?authkey=CP_H9rAC

提交回复
热议问题