I've figured out how to have the hidden form call for the REL of the pictures:
In the iFrame window, use this code:
Code:
<a href="javascript:void(0)" onClick="parent.lBiFrame(this)"><span class="style2">Click image </span><br>
<img src="thumbnail_url.jpg" alt="" name="image" width="178" height="112" border="0"></a>
<form id="lBiFrame_form" name="lBiFrame_form" method="post" action="">
<input name="LightBox_iFrame_imgUrl" type="hidden" id="LightBox_iFrame_imgUrl" value="image_url.jpg"/>
<input name="LightBox_iFrame_imgTitle" type="hidden" id="LightBox_iFrame_imgTitle" value="Image Title" />
<input name="LightBox_iFrame_imgRel" type="hidden" id="LightBox_iFrame_imgRel" value="[array_name]" />
</form>
In the Main frame window, use this code:
Code:
<!-- Start: LightBox2 iFrame Fix-->
<script type="text/javascript" language="javascript">
function lBiFrame(obj) { //Create the function for your onclick event in your link…
var iframe = window.frames['cwindow']; //this has to be the name of your iframe.
var iframeForm = iframe.document.lBiFrame_form; //this has to be the name of your frame and your form.
var hrefvalue = iframeForm.LightBox_iFrame_imgUrl.value; //this has to be the name of your "Image URL" hidden field.
var titlevalue = iframeForm.LightBox_iFrame_imgTitle.value; //this has to be the name of your "Image Title" hidden field.
var relvalue = iframeForm.LightBox_iFrame_imgRel.value; //this has to be the name of your "rel" hidden field.
var simulated_iFrameLink = document.createElement('a'); //Creates a href object
simulated_iFrameLink.setAttribute('href', hrefvalue); //Sets the href object to your lightbox image.
simulated_iFrameLink.setAttribute('title', titlevalue); //Sets the title object to your lightbox image.
simulated_iFrameLink.setAttribute('rel', 'lightbox', relvalue); //Sets rel href object to your lightbox image.
//alert ('href: ' + hrefvalue + ", Title: " + titlevalue + ', rel: lightbox' + relvalue); //For debug, to test if href, title, and rel are passed correctly..
myLightbox.start(simulated_iFrameLink); //Starts lightBox
}
</script>
<!--End Lightbox2 iFrame fix-->
Here's my problem- how do I now execute the rest of the images. I've tried placing them on the main page, placing them in the iFrame, creating more hidden forms, etc. Anyone have a clue as to how to make this work?
Bookmarks