繁体   English   中英

两个元素如何数据定位一个元素?

[英]How two elements data-target one element?

我有一个 html 页面services.html

 <div id="serviceData">
       <div class="container table-options-section ">
        <div class="row">
            <div class="col-sm-12">
                <div class="row">
                    <select class="selectpicker col-sm-2">
                        <option>1</option>
                        <option>2</option>
                    </select>
             <input class="col-sm-2" type="text" placeholder="Enter Value">              
                <select id="productSelector" class="selectpicker col-sm-2">
                        <option>3</option>
                        <option>4</option>
                    </select>
                    <button class="btn btn-success">Go</button>
            </div>
        </div>
    </div>

    <table class="table" cellpadding="0" cellspacing="0" border="1">
        <thead>
        <tr>
            <th rowspan="2"></th>
            <th rowspan="2"></th>
            <th rowspan="2"></th> 
            <th class="group-header net"></th>
            <th colspan="3" class="group-header buy"></th>
            <th colspan="3" class="group-header sell"></th>          
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="row in data track by $index" class="noFocus">
            <td>{{}}</td>
            <td>{{}}</td>
            <td>{{}}</td>
            <td>{{}}</td>
            <td>{{}}</td>
            <td>{{}}</td>
        </tr>
        </tbody>
    </table>
</div>

我想把它与两件事联系起来。 我的菜单中名为 Service 的一份。 当我点击它时,我想打开上面的 HTML 页面 (service.html)。

<li data-toggle="tab" data-target="#serviceData"><a>Service</a></li>

其他来自我的导航选项卡的同名服务。 当我点击它打开相同的 html 页面时。

<li><a data-toggle="tab" href="#serviceData">Service</a></li>

相同的 id (serviceData) 做不到。 那么怎么做呢? 欢迎任何建议。 谢谢。

更改您的菜单li代码:

<li data-toggle="tab" data-target="#serviceData"><a>Service</a></li>

到以下几点:

<li><a data-toggle="tab" href="#serviceData">Service</a></li>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM