Note that there are some explanatory texts on larger screens.

plurals
  1. POSetting href target dynamically for fancybox?
    primarykey
    data
    text
    <p>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....</p> <p>First here's the html of the iframe/fancybox element (which as a tiny button the user cannot see):</p> <p>Here's my code:</p> <pre><code>&lt;a id="link2" href="ContentPage.aspx"&gt;&lt;input id="Btn1" type="button" value="GetContent" class="smallBtnCls" /&gt;&lt;/a&gt; </code></pre> <p>..and the javascript:</p> <pre><code>function launchCont(rid){ var lnk = 'ContentPage.aspx ?act=Add&amp;id=' + rid; $('#link2').attr('href',lnk); //alert($('#link2').attr('href')); $("#Btn1").fancybox().trigger('click'); } </code></pre> <p>and the fancy box config is:</p> <pre><code> $("#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!'); } }); }); </code></pre> <p>Any Ideas???? Or am I looking at it the wrong way?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload