小编Soj*_*tin的帖子

引导程序中的嵌套选项卡

我在Bootstrap中嵌套了标签,这里是代码:http://jsfiddle.net/RLdYC/

$("ul.nav-tabs a").click(function (e) {
  e.preventDefault();
  $(this).tab('show');
});
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>



<div class="tabbable boxed parentTabs">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#set1">Tab 1</a>
        </li>
        <li><a href="#set2">Tab 2</a>
        </li>
    </ul>
    <div id="myTabContent" class="tab-content">
        <div class="tab-pane fade active in" id="set1">
            <div class="tabbable">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#sub11">Tab 1.1</a>
                    </li>
                    <li><a href="#sub12">Tab 1.2</a>
                    </li>
                </ul>
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane fade active in" id="sub11">
                        <p>Tab 1.1</p>
                    </div>
                    <div class="tab-pane fade" id="sub12">
                        <p>Tab 1.2</p>
                    </div>
                </div>
            </div> …
Run Code Online (Sandbox Code Playgroud)

javascript jquery twitter-bootstrap

25
推荐指数
1
解决办法
5万
查看次数

如何在控制器中使用辅助函数?

我在app_helper文件中写了一些函数.现在我需要在我的控制器中调用该函数如何在CAKEPHP中执行此操作

cakephp cakephp-1.3

8
推荐指数
4
解决办法
3万
查看次数

是否有第三个伪元素,比如之后和之前

我需要类似于第三个伪元素的东西.foo.bar

.foo.bar:before { content: "x "; }
.foo.bar:after { content: " x"; }

.foo.bar:before:before { content: "bad "; color: red; }
Run Code Online (Sandbox Code Playgroud)
<div class="foo">apple</div>
<div class="foo bar">orange</div>
<div class="foo">chainsaw</div>
 
Run Code Online (Sandbox Code Playgroud)

css

5
推荐指数
1
解决办法
1104
查看次数

右键单击自定义菜单无法正常工作

右键菜单正确使用其功能.但问题是有时它不能正常工作.在我的视图中,如果右键单击表格行正确选中了复选框,但在取消选中后再次尝试检查并右键单击它不起作用.

$('.check').bind("contextmenu", function (event) {
    event.preventDefault();

    $(".custom-menu").finish().toggle(100).css({
        top: event.pageY + "px",
        left: event.pageX + "px"
    });
});


$(document).bind("mousedown", function (e) {
    if (!$(e.target).parents(".custom-menu").length > 0) {
        $(".custom-menu").hide(100);
    }
});


$('tr.check').contextmenu(function (e) {
    $cb = $(this).find('input[type="checkbox"].selected_check');
    $($cb).attr('checked', 'checked');
    populate_context_menu($cb);

    return false;
});
Run Code Online (Sandbox Code Playgroud)

javascript checkbox jquery right-click tablerow

5
推荐指数
1
解决办法
150
查看次数

我使用fadeIn()错了吗?

看看fadeIn()我得到的印象是我只需要.fadeIn("slow")像这样添加一个元素

$('#template').tmpl(data).prependTo('#content').fadeIn("slow");
Run Code Online (Sandbox Code Playgroud)

但它瞬间出现,甚至没有出错.

这里可以看到

http://jsfiddle.net/HYLYq/8/

$(document).ready(function(){    
  $('form').live('submit', function(){
      var aform = $(this).serializeArray();  
      var data = {};
      var i = aform.length; 
      while(i--) {
          data[aform [i].name] = aform [i].value;
      } 
      $('#template').tmpl(data).prependTo('#content').fadeIn("slow");
      return false;      
  });
});
Run Code Online (Sandbox Code Playgroud)
    <script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
    <script src="http://jqueryui.com/ui/jquery.ui.core.js"></script>
    <script src="http://jqueryui.com/ui/jquery.ui.widget.js"></script>
    <script src="http://jqueryui.com/ui/jquery.ui.datepicker.js"></script>
    <!-- jQuery.tmpl() -->
    <script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>

    <script src="http://jqueryui.com/external/jquery.bgiframe-2.1.2.js"></script>
    <script src="http://jqueryui.com/ui/jquery.ui.core.js"></script>
    <script src="http://jqueryui.com/ui/jquery.ui.widget.js"></script>
    <script src="http://jqueryui.com/ui/jquery.ui.mouse.js"></script>
    <script src="http://jqueryui.com/ui/jquery.ui.button.js"></script>
    <script src="http://jqueryui.com/ui/jquery.ui.draggable.js"></script>
    <script src="http://jqueryui.com/ui/jquery.ui.position.js"></script>
    <script src="http://jqueryui.com/ui/jquery.ui.dialog.js"></script>

    <!-- template that will be used for inserting a form live when the okay …
Run Code Online (Sandbox Code Playgroud)

javascript jquery

2
推荐指数
1
解决办法
119
查看次数

为什么XMPP服务器会忽略我的昵称请求订阅?

我正在尝试通过Strophe.js(1.2.0)向XMPP服务器(OpenFire 3.9.3)发送订阅请求.

<presence type="subscribe" from="agent@localhost" to="agent3@localhost" xmlns="jabber:client">
<nick xmls="http://jabber.org/protocol/nick">agent3</nick>
</presence>
Run Code Online (Sandbox Code Playgroud)

名单项已创建,但没有昵称.

Openfire调试日志:

2015.04.22 11:57:43 XMPPServlet - 447b9ca3ad42f7bc78e09d35b882dfb3 : onMessage : Received : <presence type='subscribe' from='agent@localhost' to='agent3@localhost' xmlns='jabber:client'><nick xmls='http://jabber.org/protocol/nick'>agent3</nick></presence> 
2015.04.22 11:57:43 XMPPServlet - 447b9ca3ad42f7bc78e09d35b882dfb3 : Delivered : <iq type="set" id="232-173" to="agent@localhost/f0ddfe38-7bdd-fc6b-04a7-e63a7e30bf89"><query xmlns="jabber:iq:roster"><item jid="agent3@localhost" ask="subscribe" subscription="none"/></query></iq>
Run Code Online (Sandbox Code Playgroud)

xmpp openfire strophe

2
推荐指数
1
解决办法
544
查看次数

防止在Jquery中删除退格键

我有一个文本框。当用户按下退格键时,我要防止退格键删除文本,并发出特定的警报,例如“您要删除”吗?以及两个按钮。仅当用户确认删除操作时,随后单击退格按钮才会删除文本。

我写了下面的代码。虽然效果很好。但是它不能防止退格键删除文本。有人可以帮我吗?

$("#txtCustNameSHP").keyup(function (e) {
    var key = event.keyCode || event.charCode;
    if (keypresscount == 0 && key == 8 || key == 46) {
        event.preventDefault();
        $.uxMsg({
            title: "Confirmation",
            msg: "Do you want to delete the Shipper?",
            button1Text: "YES",
            button2Text: "NO",
            button1Click: function () {
                // CUSTOMER LOV
                //$("#" + txtCustCodeSHP).text("");                        
                keypresscount++;
            },
            button2Click: function () {
                return false;
            },
            width: "350px",
            height: "100px"
        });
    }
});
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input id="txtCustNameSHP" value="foobar" />
Run Code Online (Sandbox Code Playgroud)

jquery keycode keypress backspace

2
推荐指数
2
解决办法
4243
查看次数

带拖动手柄的 Dnd-kit 可排序列表 - setActivatorNodeRef 无效

我对dnd-kit库有疑问。我正在尝试使用拖动手柄激活器实现可排序列表。问题是我无法将拖动手柄(按钮)设置为仅拖动激活器。相反,整个父元素保持活动状态。

SortableItem成分:


    const SortableItem: FunctionComponent<{ id: string }> = (props) => {
      const {
        attributes,
        listeners,
        setNodeRef,
        setActivatorNodeRef,
        transform,
        transition,
      } = useSortable({ id: props.id });


      const context: Context = {
        attributes: attributes,
        listeners: listeners,
        setActivatorNodeRef: setActivatorNodeRef
      }


      return (
        <SortableItemContext.Provider value={context}>
          <div ref={setNodeRef} {...attributes} {...listeners}>
            {props.children}
          </div>
        </SortableItemContext.Provider>
      );
    }

Run Code Online (Sandbox Code Playgroud)

DragHandle成分:


    export const DragHandle: FunctionComponent = () => {

      const { attributes, listeners, setActivatorNodeRef } = useContext(SortableItemContext);
      return <button type="button"
                     className="DragHandle"
                     {...attributes} {...listeners}
                     ref={setActivatorNodeRef}>
        <svg viewBox="0 …
Run Code Online (Sandbox Code Playgroud)

drag-and-drop reactjs react-hooks dnd-kit

1
推荐指数
1
解决办法
4706
查看次数