PDA

View Full Version : Carousel II new window



Drachsi
02-05-2009, 02:43 PM
For a simple installation, install the Lightbox 2.03a scripts and styles in the head of the page as instructed on the Lightbox 2.03a demo page. And install the Carousel script according to it's instructions on its demo page.

Then of course, for the Carousel array, use your image/larger image pairs, ex:


Car_Image_Sources=new Array(
"photo1.jpg","photo1_lrg.jpg",
"photo2.jpg","photo2_lrg.jpg",
"photo3.jpg","photo3_lrg.jpg",
"photo4.jpg","photo4_lrg.jpg" // NOTE No comma after last line
);

Replace this code in the Carousel script (at the end):


function C_LdLnk(){if(this.lnk)window.location.href=this.lnk}
function C_Stp(){this.style.cursor=this.lnk?"pointer":"default";C_Stppd=true;}
function C_Rstrt(){C_Stppd=false}

with this code:


function C_LdLnk(){if(this.lnk && !Carousel.lnks[this.lnk]){
Carousel.lnks[this.lnk] = document.createElement('a');
Carousel.lnks[this.lnk].href = this.lnk;
Carousel.lnks[this.lnk].rel = 'lightbox';
} if(this.lnk) myLightbox.start(Carousel.lnks[this.lnk]);}
function C_Stp(){this.style.cursor=this.lnk?"pointer":"default";C_Stppd=true;}
function C_Rstrt(){C_Stppd=false}
Carousel.lnks = {};
Hi, I'm very new here, but the carousel script is great, just how do I modify the array so that a url opens in either new window like
<script type="text/javascript">
<!--
function opencontactWin(){
winTech=window.open('contact-form.htm','contact','height=600,width=550,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=), scrollbars=0')
}
// --></script>

or even just a new smaller window, if possible with all menus and a fixed size.

refers to:
http://www.dynamicdrive.com/forums/showthread.php?t=41445

jscheuer1
02-05-2009, 04:33 PM
From the demo page, Step 2, third Carousel:



lnk_targets:['photo', //link target for each link (see: http://www.codingforums.com/showthread.php?t=58814&page=2)
'photo',
'_blank',
'_top.steve' ],
lnk_attr:['width=700,height=600,top=200,menubar=yes', //window attribute for each pop up (see url above for docs)
'width=700,height=600,left=400,scrollbars=yes',
'width=750,height=550,left=300,top=100',
''],

So basically you set the target to a unique window name (not to a frame or iframe name), or to _blank, and then set the corresponding attr properties (specifications) for that window.