2015-09-15 134 views
0

我已经搜索没有太大的成功,我有一个“客户”页面约60客户端听。每个人都有一个独特的模式,打开更多的信息和细节。我想要的是引用主页上的一些顶级客户端,并带有链接以打开已打开模式的客户端页面。这是我接手的一个项目,所以js文件是一个可以挖掘的老鼠窝。希望有一个更简单的答案。链接打开页面模式有效

链接股利

<pre class="default prettyprint prettyprinted"> 
    <code> 
     <span class="tag">&lt;a href="#champion2" data-toggle="modal" data-target="#champion2" class="item-img-overlay"></span> 
    </code> 
</pre> 

ID形式

<pre class="default prettyprint prettyprinted"> 
    <code> 
     <span class="tag">&lt;div class="modal fade" id="champion2" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></span> 
    </code> 
</pre> 

如有任何JS或方式帮助我应该链接的URL分别内衬时对上述开放。

回答

0

我能够得到这个工作的一些帮助。我有另一个哈希过滤器需要解决这个问题。代码是

$(document).ready(function() { 
    var hash = window.location.hash; 
    var isClientModalRequest = hash.indexOf('client') > -1; 

    if (!isClientModalRequest) 
     return; 

    var client = hash.split('=')[1]; 
    var element = $('#' + client); 

    element.modal('show'); 
    element.css('display', 'block'); 
    element.addClass('in'); 
}); 
相关问题