Sorry for the delay, here's what i did to have a shadowbox iframe content linked from another website:
JS:
<script type="text/javascript">
//init shadowbox
Shadowbox.init({
language: 'it',
players: ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv']
});
//get the url and split the id string
var url = document.location.href;
var idlibro = url.split("id=");
if(idlibro[1]!=undefined){
Shadowbox.init({
// let's skip the automatic setup because we don't have any
// properly configured link elements on the page
skipSetup: true,
// include the html player because we want to display some html content
players: ["iframe"]
});
window.onload = function(){
var host = "http://www.edpr.it/schede/";
var host2 = host.concat(idlibro[1]);
var url = host2.concat("int.html");
// get the url generated by concat
Shadowbox.open({
content: url,
player: "iframe",
});
};
};
</script>
HTML:
<a href="schede/066int.html" rel="shadowbox"><img src="images/thumbs/066.jpg" alt="Prospettive Edizioni srl" /></a>
With this if you enter to the website directly you have the classic shadowbox, load when click over a cover, but if you click on a website that have this url
http://www.edpr.it/index.asp?id=066the javascript will read the id and with concat it makes possible to load the page associated with the shadowboxed cover referred by the id.
The problem now is that when a shadowbox is opened from an external website with this method i've on the browser url "
http://www.edpr.it/index.asp?id=065" that after closing the automatic loaded shadowbox don't appear as the main page url "
http://www.edpr.it", i've tried to add
window.location.href('http://www.edpr.it')
at the onclose event into shadowbox.js but it force a reload of the main page.
Coming from an external website with this method works, but will keep the id string on the url if i don't find a way to clear the string with the "onclose" in shadowbox.js
I've also tried to have a complete "id" management for every shadowbox, to make them bookmarkable with this:
JS:
<script type="text/javascript">
function substitute(addon){
var urlset = "http://www.edpr.it/index.asp";
var fixurl = urlset += addon;
window.location = fixurl;
}
</script>
HTML:
<a href="schede/066int.html" rel="shadowbox" /onclick="substitute('?id=066')"><img src="images/thumbs/066.jpg" alt="Prospettive Edizioni srl" /></a>
(onclick isn't allowed with tag a in this board, consider the slash a trick to show it, not a sintax error)
Now every time that you click on a shadowboxed cover(image) you have his unique url like
http://www.edpr.it/index.asp?id=066 for cover X
http://www.edpr.it/index.asp?id=065 for cover Y
...
http://www.edpr.it/index.asp?id=xxx for cover Z
The problem is also the same:
Page reload
With this method every time you click on a shadowbox you have an home page reload that in automatic loads the shadowbox by the string id and then, after clicking close, through the on close window.location.href('
http://www.edpr.it') in the shadowbox.js used to reset the url, you another home page reload.
I don't know if is possible to obtain what i did without all these page reload with my basic skills, but the simple thing that i need at the end of all is to have unique id for each shadowboxed url so i can refer the shadowboxed content in other websites and in the same time the possibility to have each shadowbox bookmarkable so i can recall it with an auto load.
Thank you for the patience to read all, and if something isn't clear i'm here to explain it better!