小编Kar*_*ski的帖子

jQuery,fancybox工作,但只有当你点击这个图像两次

我有个问题 ...

JS

$('#Contact').ready(function(){
    $('a#Contact-Map').live('click',function(event){
        event.preventDefault();
        $('a#Contact-Map').fancybox({
            'transitionIn'  :   'elastic',
            'transitionOut' :   'elastic',
            'speedIn'           :   600, 
            'speedOut'          :   200, 
            'overlayShow'   :   true
        });
    });
});
Run Code Online (Sandbox Code Playgroud)

HTML

<div class="Module-Frame" id="Contact">
    <a id="Contact-Map" href="./Modules/Contact/Images/mapa_big.png">
        <img src="./Modules/Contact/Images/mapa.png" alt=""/>
    </a>
</div>
Run Code Online (Sandbox Code Playgroud)

这个HTML代码由.load()jQuery函数加载.这是有效的,但只有当你点击这个图像两次...

帮助请:)


JS with load()func

$(document).ready(function(){

    $("#Menu").children().click(function(event){
        $("#Content").hide().load('./Modules/'+ event.target.id.substr(5) +'/index.php', function() {
            $(this).fadeIn();
        });
    });



});



HTML

< html  >
< head  > ...

...
<body>
...
            <div id="Menu">
                <a id="Menu-News" href="#" title="Aktualnosci"> aktualno?ci  |
                <a id="Menu-Aboutus" href="#" title="O nas"> o nas  | 
                <a id="Menu-Contact" …

jquery click live fancybox

2
推荐指数
1
解决办法
5949
查看次数

标签 统计

click ×1

fancybox ×1

jquery ×1

live ×1