Hi, I'm trying to include social share buttons in my panoramas wich javascript, so this is how I do it :
in my xml file :
in my pano html page :
function add_to_facebook() {
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(document.location)+'&t='+encodeURIComponent(document.title),'sharer','toolbar=0,status=0,width=626,height=436');return false;
}
this works perfect, but the problem is that I open my panoramas in a shadowbox, if I call my panorama this way in the shadowbox
it calls the function from the parent page wich is what I want (to have the url of the parent page)
but I would like to call my panorama this way:
for many reasons (analytics tracking, mobile compatibility...)
the problem is that if I call my pano with it's html page, then the onclick="js( add_to_facebook() ) calls the function from mypano.html and not from the parent page... (am I clear ?)
Is there a way to create a javascript function in mypano.html page wich would call my add_to_facebook() function from the parent page :
xml : onclick="js( call_facebook() ) >>
mypano.html: function call_facebook() {window.opener.add_to_facebook()} >>
parent page: function add_to_facebook() {
window.open('http://www.facebook.com/sharer.php?u='…=626,height=436');return false;
}
I tried with window.opener but it doesn't work... any idea ?
Many thanx !!!