Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I found the answer, unfortunately never (!) from my own question on the forums... i share it with you, maybe it helps for someone :</p> <p>1 First i had the .css and .js files linked to both parent html and iframe html.</p> <p>2 My parent html</p> <pre><code>&lt;body&gt; &lt;div id="more"&gt; &lt;div class="container"&gt; &lt;div id="sensuality-div"&gt; &lt;iframe id="sensuality-frame" src="http://www.igorlaszlo.com/sensuality.html" width="100%" height="100%" style="overflow:hidden;height:100%;width:100%;" scrolling="no" allowTransparency="true" frameborder="0" sandbox="allow-same-origin allow-forms allow-scripts" &gt;&lt;/iframe&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>3 My iframe html</p> <pre><code>&lt;body id="sensuality-body"&gt; &lt;div class="view view-add"&gt; &lt;img src="http://www.igorlaszlo.com/uploads/thumbs/41.jpg" alt="Thierry Mercier 16" /&gt; &lt;div class="mask"&gt; &lt;a href="http://www.igorlaszlo.com/uploads/images/41.jpg" class="fancybox-thumbs" rel="group1" alt="Model : Thierry Mercier - 2009 June" title="34 Dance in the Dark"&gt; &lt;h4&gt;Dance in the Dark&lt;/h4&gt; &lt;p&gt;Model : Thierry Mercier&lt;/p&gt; &lt;info&gt;Click for zoom&lt;/info&gt; &lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="view view-add"&gt; &lt;img src="http://www.igorlaszlo.com/uploads/thumbs/41.jpg" alt="Thierry Mercier 16" /&gt; &lt;div class="mask"&gt; &lt;a href="http://www.igorlaszlo.com/uploads/images/41.jpg" class="fancybox-thumbs" rel="group1" alt="Model : Thierry Mercier - 2009 June" title="34 Dance in the Dark"&gt; &lt;h4&gt;Dance in the Dark&lt;/h4&gt; &lt;p&gt;Model : Thierry Mercier&lt;/p&gt; &lt;info&gt;Click for zoom&lt;/info&gt; &lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>4 My original code for calling fancybox (not manual opening) is in the followings (i have it on both parent and iframe pages):</p> <pre><code>&lt;script&gt; $(document).ready(function() { $(".fancybox-thumbs").fancybox({ padding: 0, openEffect : 'elastic', openSpeed : 150, closeEffect : 'elastic', closeSpeed : 150, closeClick : true, prevEffect : 'elastic', nextEffect : 'elastic', closeBtn : true, arrows : true, nextClick : true, beforeShow: function () { this.title = $(this.element).attr('title'); this.title = '&lt;h3&gt;' + this.title + '&lt;/h3&gt;' + $(this.element).attr('alt') + '&lt;br /&gt;'; }, afterShow: function() { }, helpers : { title : { type: 'inside' } } }); }); &lt;/script&gt; </code></pre> <p>5 THE HACK : I combined the code i found (<a href="http://www.dynamicdrive.com/forums/archive/index.php/t-56981.html" rel="nofollow">http://www.dynamicdrive.com/forums/archive/index.php/t-56981.html</a>) with mine and i ADDED AN ADDITIONAL SCRIPT to my iframe page:</p> <pre><code>&lt;script type="text/javascript"&gt; jQuery(function($) { if(top !== window){ var $$ = parent.jQuery; $$('#sensuality-div').html($('#sensuality-body').html()).find('a').fancybox({ padding: 0, openEffect : 'elastic', openSpeed : 150, closeEffect : 'elastic', closeSpeed : 150, closeClick : true, prevEffect : 'elastic', nextEffect : 'elastic', closeBtn : true, arrows : true, nextClick : true, beforeShow: function () { this.title = $(this.element).attr('title'); this.title = '&lt;h3&gt;' + this.title + '&lt;/h3&gt;' + $(this.element).attr('alt') + '&lt;br /&gt;'; }, afterShow: function() { }, helpers : { title : { type: 'inside' } } }); $("#sensuality-body a").click(function(e){ $$('#' + this.class).click(); }); } else { $("#sensuality-body a").fancybox({ padding: 0, openEffect : 'elastic', openSpeed : 150, closeEffect : 'elastic', closeSpeed : 150, closeClick : true, prevEffect : 'elastic', nextEffect : 'elastic', closeBtn : true, arrows : true, nextClick : true, beforeShow: function () { this.title = $(this.element).attr('title'); this.title = '&lt;h3&gt;' + this.title + '&lt;/h3&gt;' + $(this.element).attr('alt') + '&lt;br /&gt;'; }, afterShow: function() { }, helpers : { title : { type: 'inside' } } }); } }); &lt;/script&gt; </code></pre> <p>Maybe you can make it much easier, maybe i added a lot of unnecessary codes, what i know is that it works fine...</p> <p>I saw that many people look for a solution for that kind of question, hope to help you !</p> <p>Soon you will be able to see it on <a href="http://www.igorlaszlo.com" rel="nofollow">www.igorlaszlo.com</a></p>
    singulars
    1. This table or related slice is empty.
    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.
    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