简体   繁体   English

用可用内容加载Kendo TabStrip

[英]Load Kendo TabStrip with available content

I have three tabs and I would like to populate those tabs with section contents that is already present on the page: 我有三个标签,我想用页面上已经存在的部分内容填充这些标签:

<section class="rbs-section" id="rbi_S_12466479" name="world1">
<p>Hello World1</p>
</section>

<section class="rbs-section" id="rbi_S_12466477" name="world2">
<p>Hello World2</p>
</section>

<section class="rbs-section" id="rbi_S_12466478" name="world3">
<p>Hello World3</p>
</section>

My TabStrip: 我的TabStrip:

<div id="tabstrip">
                            <ul>
                                <li class="k-state-active">
                                    World1
                                </li>
                                <li>
                                    World2                                    </li>
                                <li>
                                    Wordl3
                                </li>
                            </ul>
                        </div>

Javascript: 使用Javascript:

$(document).ready(function() {
                    $("#tabstrip").kendoTabStrip({
                        animation:  {
                            open: {
                                effects: "fadeIn"
                            }
                        }
                    });
                });

How can I use Kendo TabStrip code to use my custom sections in those tabs? 如何使用Kendo TabStrip代码在这些选项卡中使用我的自定义部分? Kindly let me know. 请让我知道。

Cheers. 干杯。

here is a dojo with a working example. 这是一个带有示例的道场。 Tab strip with sections. 带部分的标签条。

You will notice that all I have done is wrap you sections with a div. 您会注意到,我所做的只是用div包装您的sections

the tab strip expects to see a div within the content collection as the child element ie the content. 标签栏希望在内容集合中看到一个div作为子元素,即内容。

hopefully this answers your question. 希望这能回答您的问题。 If you need any further details let me know. 如果您需要更多详细信息,请告诉我。

UPDATE UPDATE

I have updated the dojo. 我更新了道场。 It is not the most elegant way of doing it but it will work without you changing your DOM to much. 这不是最优雅的方法,但是无需将DOM更改太多就可以使用。

updated dojo 更新的道场

UPDATE 2 updated dojo 2 UPDATE 2 更新了dojo 2

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

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