OK, replace:
Code:
<script type="text/javascript" src="ajaxtabs/ajaxtabs.js"></script>
with:
Code:
<script type="text/javascript" src="jqueryloadajax.js"></script>
In jqueryloadajax.js put:
Code:
jQuery(function($){
var ajaxrel = 'countrycontainer', //set rel attribute for ajax activation
ajaxtarget = 'right_container', //set id of target container
hash = location.hash.replace(/#/, '');
ajaxtarget = $('#' + ajaxtarget);
$('a[rel=' + ajaxrel + ']').click(function(e){
e.preventDefault();
var url = this.href;
ajaxtarget.load(url, function(){
location.hash = '#' + url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.'));
$("a[rel=example_group]").fancybox({
'transitionIn' : 'elastic',
'transitionOut' : 'elastic',
'titlePosition' : 'over',
'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' ' + title : '') + '</span>';
}
});
});
}).each(function(){
if(this.href.indexOf(hash) > -1){
$(this).click();
return false;
}
});
});
Get rid of:
Code:
<script type="text/javascript">
var countries=new ddajaxtabs("countrytabs", "right_container")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init();
countries.onajaxpageload = function(pageurl){
location.hash = '#' + pageurl.substring(pageurl.lastIndexOf('/') + 1, pageurl.lastIndexOf('.'));
jQuery("a[rel=example_group]").fancybox({
'transitionIn' : 'elastic',
'transitionOut' : 'elastic',
'titlePosition' : 'over',
'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' ' + title : '') + '</span>';
}
});
};
</script>
But there will still be at least one problem. I see that you're planning on using the same filename for antiques and probably repros as well for various items, just in different folders. So our original plan and this one will fail once that's established, unless you can use unique filenames for those pages, or we rethink the hash and/or how it's applied. We could perhaps include a rev attribute for those links requiring a folder.
Bookmarks