gallery script of v2.x in v.1.4 ?

Nicky

Avatar: Nicky

2011-02-04 19:09

The popup gallery of the version 2.x runs much smooth and also seems to work ok in all browsers.

Is it possible to use that gallery.js script in the 1.x version?

I know of 2 files : gallery.js and gallery.tpl

When I replace those 2 files in v.1.x by those of v2.x, i get following errors:

No block: PHOTO_DEFAULT in file: templates/gallery.tpl
No block: PHOTO_LIST in file: templates/gallery.tpl
No block: PHOTO_LIST in file: templates/gallery.tpl
No block: PHOTO_LIST in file: templates/gallery.tpl
No block: PHOTO_FOOTER in file: templates/gallery.tpl
No block: SHOW in file: templates/gallery.tpl

Do I have to modify more files, or is it just impossible to do....?

The reason why I still use v1.x is that I want to integrate the shop in my own specific template (with 'wrapper' system). Lightbox gallery is no option here, since the overlay of the lightbox stays inside the 'iframe' of the shop.

Thanks in advance.

» Quick.Cart v1.x

Nicky

Nicky

Avatar: Nicky

2011-02-05 12:54

For improved version which works in Safari, IE and Firefox, just 1 file to replace, which is js/gallery.js

following code:

/*
* ver. 1.0-rc2
*/

var isNN,isIE;
if ( parseInt( navigator.appVersion.charAt( 0 ) ) >= 4 ){
isNN = ( navigator.appName == "Netscape" ) ? 1 : 0;
isIE = ( navigator.appName.indexOf( "Microsoft" ) != -1 ) ? 1 : 0;
isOp = ( navigator.appName == "Opera" ) ? 1 : 0;
}
var iPlusWidth = 60;
var iPlusHeight = 120;
var sId = "oPhoto";
function reSizeToImage( ){
if( gEBI( "butt" ) )
gEBI( "butt" ).style.margin = "auto";

width = gEBI( sId ).width+iPlusWidth;
height = gEBI( sId ).height+iPlusHeight;

if( width > screen.availWidth ){
width = screen.availWidth - screen.availWidth / 5;
document.body.scroll = "yes";
}
if( height > screen.availHeight ){
height = screen.availHeight - screen.availHeight / 5;
document.body.scroll = "yes";
}
window.resizeTo( width, height );
moveWindowToImage( width, height );

}

function moveWindowToImage( iWindowWidth, iWindowHeight ){

var iPosX = ( screen.availWidth - iWindowWidth ) / 2;
var iPosY = ( screen.availHeight - iWindowHeight ) / 2;

window.moveTo( iPosX, iPosY );

} // end function moveWindowImage
function doTitle( sTitle ){
document.title = sTitle;
gEBI( sId ).title = sTitle;
gEBI( sId ).alt = sTitle;
gEBI( sId ).onmouseover = function () {
window.status = sTitle;
}
}

function showLinks( iPhoto ){
if( aPhotos[iPhoto][2] != '' )
doTitle( aPhotos[iPhoto][2] );
else
doTitle( opener.document.title );
if( aPhotos[iPhoto+1] ){
gEBI( "oLR" ).style.display = "";
var iNext = iPhoto+1;
gEBI( "oLR" ).onclick = 'loadImg( '+ iNext +' );';
gEBI( "oLR" ).href = 'javascript:loadImg( '+ iNext +' );';
}
else
gEBI( "oLR" ).style.display = "none";
if( aPhotos[iPhoto-1] ){
gEBI( "oLL" ).style.display = "";
var iPrev = iPhoto-1;
gEBI( "oLL" ).onclick = 'loadImg( '+ iPrev +' );';
gEBI( "oLL" ).href = 'javascript:loadImg( '+ iPrev +' );';
}
else
gEBI( "oLL" ).style.display = "none";
} // end function showPict

function loadImg( iPhoto ){
var img = new Image();
img.onload = function( e ) {
var im = document.createElement( 'IMG' );
var obj= document.getElementById( 'oPhotoDiv' );
im.src = this.src;
obj.innerHTML = '';
obj.appendChild( im );
im.id = "oPhoto";
gEBI( 'oPhoto' ).onclick = function(){
window.close( );
}
reSizeToImage( );
showLinks( iPhoto );
}
img.src = aPhotos[iPhoto][1];
}

Nicky

Back to top
about us | contact