Fancybox Close button disappearing when clicked

你离开我真会死。 提交于 2020-01-17 03:37:06

问题


I am currently using fancybox version 2.1.5, the problem i am encountering is when I click on the close button "x" on the iframe, the close button "x" disappears rather than closing the iframe. Has anyone else encountered this error while using fancybox? Please visit this page and click "details" and the close button "x" to experience the error. http://www.jerrellkbryant.com/jbcom/portfolio

<div><a class="various small_button shadow none" data-fancybox-type="iframe" href="details/clear.html">View Details</a><a class="small_button shadow"  rel="nofollow" href="http://www.jerrellkbryant.com/redventures/" target="_blank"> Visit Website</a></div>


jQuery(document).ready(function(){
$(".various").fancybox({
    type        :'iframe',
    scrolling   : 'no',
    maxWidth    : 800,
    maxHeight   : 400,
    fitToView   : true,
    width       : '70%',
    height      : '70%',
    autoSize    : false,
    closeClick  : true,
    openEffect  : 'none',
    closeEffect : 'none',
});

回答1:


Generally speaking it's not a good idea to set general CSS rules.

In your style css file you have these rules (from line 286)

a{text-decoration:none; color:#393631}
a:visited{/*opacity:0.8; */ /* A bit basic,but it's a bare minumum... */}
a:hover{text-decoration:none; /*background:#c1f4e3;*/ color:#393631}
a:active, 
a:focus{position:relative; top:1px; outline:none}

that are affecting the position of fancybox close button (which is an anchor)

Use some specificity instead so only those you target are affected like :

#content a{text-decoration:none; color:#393631}
#content a:visited{/*opacity:0.8; */ /* A bit basic,but it's a bare minumum... */}
#content a:hover{text-decoration:none; /*background:#c1f4e3;*/ color:#393631}
#content a:active, 
#content a:focus{position:relative; top:1px; outline:none}


来源:https://stackoverflow.com/questions/20152393/fancybox-close-button-disappearing-when-clicked

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!