开发者

Making a DIV hide once FancyBox is opened

开发者 https://www.devze.com 2023-04-09 17:41 出处:网络
I\'m trying to make an Div disappear when you click the open FancyBox button. My code is: $(document).ready(function() {

I'm trying to make an Div disappear when you click the open FancyBox button.

My code is:

$(document).ready(function() {
    $('#tag_100_not').fancybox({
        'transitionIn'        : 'elastic'  ,
        'transitionOut'       : 'elastic'  ,
        'hideOnOverlayClick'  : false      ,
        'hideOnContentClick'  : false      ,
        'showCloseButton'     : false      ,
        'overlayOpacity'      : 0.6        ,
        'onStart'             : function() {
            $('#tag_100_not').css('display', 'none');
        },

        'onComplete'          : function() {
            $开发者_Python百科('#tag_100_not').css('display', 'none');
        }
    });
});

EDIT:

MarkUp:

    <th class="num" style="position:relative;"><a id="tag_100_not" href="#tag_100_box"  style="width:100%;height:100%;top:0;left:0;position:absolute;display:block;"></a>100</th`>

The div is not disappearing.

I tried, onStart and onComplete, none work.


not sure if it works for one rule, but as far as i know, the css method always accepts a hash

$('#tag_100_not').css({'display':'none'})

Though you can always save typing and just use the hide function:

$('#tag_100_not').hide()
0

精彩评论

暂无评论...
验证码 换一张
取 消