【问题标题】:how to check fancybox open or not如何检查fancybox是否打开
【发布时间】:2013-08-10 11:41:15
【问题描述】:

我只想检查一个文本框以打开 Fancybox。
如果文本框为空,那么我希望 Fancybox 工作,否则我只想重定向另一个页面。我该怎么做。

当我点击“内联”然后打开 div 时,我有我的 Fancybox。

<a class="fancybox" href="#inline1">Inline</a>  
<div id="inline1" style="width:400px;display: none;">
    <h3>Etiam quis mi eu elit</h3> 
</div>

但我有另一个带有文本框的按钮,它在我的网页中搜索某些内容。

<form action="/Isim/Arama" method="get">    
    <input type="text" id="searchedPart" class="searchedName generalTextArea" name="searchedPart" value=""> 
    <input class="searchNameSearchButton" type="submit" value="">
</form>

现在我想要以下

如果搜索到的部分为空
然后显示fancybox
其他
做它现在做的事情

【问题讨论】:

标签: javascript jquery forms get fancybox


【解决方案1】:

使用javascript可以帮你解决这个“如果searchedPart为空,则显示fancybox 否则做它目前所做的”

$(document).ready(function() {
   $('#searchedPart').keyup(function() {
       if($('#searchedPart').val()) {
         $('.fancybox').css('display','none');
       }
   });
});

祝你好运!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    相关资源
    最近更新 更多