<p>Set <a href="http://buildwithcraft.com/docs/config-settings#generateTransformsBeforePageLoad" rel="nofollow">generateTransformsBeforePageLoad</a> in your config/general.php file.</p>

<pre><code>'generateTransformsBeforePageLoad' =&gt; true,
</code></pre>

<blockquote>
  <p>Configures Craft to generate new image transforms right when getUrl()
  is called, rather than when the browser first requests the image.</p>
</blockquote>

CC BY-SA 3.0
2015-04-24T05:00:35.423Z
2015-04-24T05:00:35.423Z
Eli Peters
<p>Im creating a gallery for Fancybox and only wish to show the first image. The rest are hidden in a container and only referenced so that Fancybox can call on these latter. I've tried two approaches: anchor tag with and without the image tag.</p>

<p>I am sure that this is a recent change as I have been using this technique on earlier craft versions and gettting good results.</p>

<pre><code>&lt;div class="hide"&gt;
  &lt;a title="{{ image.title }}" href="{{ image.getUrl('wide') }}" class="fb" rel="fb-{{ ind }}"&gt;
    &lt;img src="{{ image.getUrl('wide') }}" title="{{ image.title }}" style="display: block!important" /&gt;
  &lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>The image is generated but it looks like in a temporary location "...cpresources/transforms..." to which Fancybox doesn't recognise.</p>

CC BY-SA 3.0
2015-04-23T23:45:30.700Z
Just found the answer from an old colleague http://craftcms.stackexchange.com/questions/8712/cache-coldcache-checking-for-ungenerated-image-transforms/8713#8713
Eli Peters
CC BY-SA 3.0
2015-04-24T02:48:00.093Z
Wanna add that as an official answer, Eli?
Brad Bell
<image-transforms>
Why does asset creation not work for hidden images?
# Why does asset creation not work for hidden images?

(Asked by: username_0 on 2015-04-23)

Im creating a gallery for Fancybox and only wish to show the first image. The rest are hidden in a container and only referenced so that Fancybox can call on these latter. I've tried two approaches: anchor tag with and without the image tag.
I am sure that this is a recent change as I have been using this technique on earlier craft versions and gettting good results.

  
    
  


The image is generated but it looks like in a temporary location "...cpresources/transforms..." to which Fancybox doesn't recognise.

**Tags:** image-transforms

> **Comments:**
> **username_0**: Just found the answer from an old colleague http://craftcms.stackexchange.com/questions/8712/cache-coldcache-checking-for-ungenerated-image-transforms/8713#8713  
> **username_1**: Wanna add that as an official answer, Eli?  

---

## 1 answers

### Answer by username_0 on 2015-04-24. Score: 2 | Accepted answer

Set generateTransformsBeforePageLoad in your config/general.php file.
'generateTransformsBeforePageLoad' => true,


Configures Craft to generate new image transforms right when getUrl()
  is called, rather than when the browser first requests the image.


---

