Ok, I have used fancybox already with some success, but I was wondering if I could pass a value for the href? I've kinda put a clunky solution together, but the box tells me " The requested content cannot be loaded. Please try again later." What I've done is created a separate function to trigger the launch of the fancybox....
First here's the html of the iframe/fancybox element (which as a tiny button the user cannot see):
Here's my code:
<a id="link2" href="ContentPage.aspx"><input id="Btn1" type="button" value="GetContent" class="smallBtnCls" /></a>
..and the javascript:
function launchCont(rid){
var lnk = 'ContentPage.aspx ?act=Add&id=' + rid;
$('#link2').attr('href',lnk);
//alert($('#link2').attr('href'));
$("#Btn1").fancybox().trigger('click');
}
and the fancy box config is:
$("#Btn1").click(function() {
$("#link2").fancybox({
'width': '55%',
'height': '45%',
'autoScale': false,
'modal': true,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'type': 'iframe',
onStart: function() {
//return window.confirm('Continue?');
$.fancybox.showActivity();
},
onCancel: function() {
//alert('Canceled!');
},
onComplete: function() {
//alert('Completed!');
$.fancybox.hideActivity();
},
onCleanup: function() {
//return window.confirm('Close?');
},
onClosed: function() {
//alert('Closed!');
}
});
});
Any Ideas???? Or am I looking at it the wrong way?
button
inside an anchor; 2: how do you call the functionlaunchCont()
(and pass the parameterrid
) ? – JFK