似乎无法在JQuery Tabs中包装WMD Markdown Editor

时间:2010-08-22 00:02:09

标签: asp.net-mvc jquery-ui wmd

我正在尝试将Markdown编辑器放在jQuery-UI选项卡中,但编辑器没有显示。

    <%  Using Html.BeginForm()%>
    <div id="AddEventWizard">
        <ul>
            <li><a href="#tabs-1">Event Title</a></li>
            <li><a href="#tabs-2">Event Description</a></li>
        </ul>
        <div id="tabs-1">
            <%: Html.LabelFor(Function(model) model.Name)%>
            <%: Html.TextBoxFor(Function(model) model.Name, New With{.class = "full-width-input"})%>
            <%: Html.ValidationMessage("Name", "*")%>
        </div>
        <div id="tabs-2">
            <noscript><h3>Please use
                <%: Html.ActionLink("Markdown", "Markdown", "About")%>
                to style your input.</h3></noscript>
            <div id="wmd-button-bar" class="wmd-panel">
            </div>
            <%: Html.TextAreaFor(Function(model) model.Description, 5, 10, New With {.id = "wmd-input", .class = "wmd-panel"})%>
            <div id="wmd-preview" class="wmd-panel">
            </div>
            <div class="clear">
            </div>
        </div>
    </div>
    <% End Using%>

<script type="text/javascript">
    $(document).ready(function () {
        $('textarea#wmd-input:not(.processed)').TextAreaResizer();

        $("#AddEventWizard").tabs({

    });
}); // closes document.ready

</script>

编辑按钮“应该”有空间,但它们不在那里。有谁知道jQuery-UI的东西是否会以某种方式阻止WMD Markdown?

Screenshot


编辑:

我正在使用 Github

中的版本

HTML标记

<form action="/events/addevent" method="post">
        <div id="AddEventWizard">

            <ul>
                <li><a href="#tabs-1">Event Title</a></li>
                <li><a href="#tabs-2">Event Details</a></li>
                <li><a href="#tabs-3">Event Description</a></li>
            </ul>
            <div id="tabs-1">
                <label for="Name">Name</label>

                <input class="full-width-input" id="Name" name="Name" type="text" value="" />

            </div>
            <div id="tabs-2"></div>
            <div id="tabs-3">
                <noscript><h3>Please use
                    <a href="/about/markdown">Markdown</a>
                    to style your input.</h3></noscript>
                <div id="wmd-button-bar" class="wmd-panel">
                </div>
                <textarea class="wmd-panel" cols="10" id="wmd-input" name="Description" rows="5">

</textarea>
                <div id="wmd-preview" class="wmd-panel">
                </div>
                <div class="clear">
                </div>
            </div>
        </div>
        </form>


<script type="text/javascript">
    $(document).ready(function () {
        $('textarea#wmd-input:not(.processed)').TextAreaResizer();

        $("#AddEventWizard").tabs({

    });
}); // closes document.ready

</script>
<script src="../../Assets/Scripts/wmd.js" type="text/javascript"></script>
<script src="../../Assets/Scripts/showdown.js" type="text/javascript"></script>
<script src="../../Assets/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="../../Assets/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
<script src="../../Assets/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>

<script src="../../Assets/Scripts/jquery.textarearesizer.compressed.js" type="text/javascript"></script>

1 个答案:

答案 0 :(得分:0)

也许你可以绑定编辑器

$('textarea#wmd-input:not(.processed)').TextAreaResizer();

不在$(文件).ready上但是点击了tab3?

以这种方式,当文本框可见时,编辑器会被加载。