hyperrjas
hyperrjas

Reputation: 10744

Div extra to close fancy box with rails 3.1

I have a div with a rails 3.1 partial and a link to open the partial in fancybox:

<div id="content">

<%= link_to "Terms of Service", "#terms-use", :class =>"terms-use" %>.

<%= render :partial => "pages/terms" %>

</div>

inside the div has a partial with id terms-use

The link generated by link_to method is:

<a class="terms-use" href="#terms-use">Terms of Service</a>

This is a fancybox javascript that I have:

$(function() {
 $("a.terms-use").fancybox({
     'titlePosition'          : 'inside',
    'transitionIn'           : 'none',
    'transitionOut'         : 'none',
     'overlayOpacity'    : '0',
     'autoDimensions'   : false,
     'width' : 610,
     'height' : 130,
     'centerOnScroll' : true, 
  });
  });

My fancy box working fine when I open it. But the problem is that when I close the fancy box create into my parent content div a new white or blank div with same heigh that fancy box. Then my parent div content is extended in that height. Its mean adds to the height of content div the heigh of fancybox. The position of this white blank div is relative.

How I can fix this?

Upvotes: 0

Views: 424

Answers (1)

JFK
JFK

Reputation: 41143

There is a bug (and a workaround) with fancybox v1.3.x described here.

Also make sure that your <div> with the terms of use content, is hidden with the following structure:

<div style="display:none;">
 <div id="terms-use">..content..</div>
</div>

Upvotes: 1

Related Questions