精华内容
下载资源
问答
  • toggle

    2018-03-26 14:04:36
    toggle对display 属性进行切换显示和隐藏如果被选元素可见,则隐藏这些元素,如果被选元素隐藏,则显示这些元素。该效果适用于通过 jQuery 隐藏的元素,或在 CSS 中声明 display:none 的元素(但不适用于 ...

    toggle对display  属性进行切换显示和隐藏

    如果被选元素可见,则隐藏这些元素,如果被选元素隐藏,则显示这些元素。

    该效果适用于通过 jQuery 隐藏的元素,或在 CSS 中声明 display:none 的元素(但不适用于 visibility:hidden 的元素)。

    $("#id").toggle();

    展开全文
  • data-toggle与data-target是什么作用

    万次阅读 2017-02-23 11:38:20
    data-toggle指以什么事件触发,常用的如modal,popover,tooltips等,data-target指事件的目标,一起使用就是代表data-target所指的元素以data-toggle指定的形式显示 data-target 与data-toggle 还有data-spy ...

     

    Bootstrap为这些a之类元素都绑定上了事件,而终止了链接默认行为。

     

    • data-toggle:指以什么事件触发相当于告诉浏览器你是一个什么组件,常用的如modal(模态框),popover(弹出框),tooltips(提示框)等,
    • data-target:指事件的设置目标,相当于告诉浏览器你要操作那个元素
    • 一起使用就是代表data-target所指的元素以data-toggle指定的形式显示

    当设置data-toggle="link"data-target="class"之后,bootstrap.js会使用这些值覆盖超链接的默认属性


    以下为转载

    HTML5允许开发者自由为其标签添加属性,这种自定义属性一般用“data-”开头。

    我目前理解到在bootstrap中data-target,data-toggle等属性主要有两种作用:
    【1.】在CSS中作标签选择器用。
    如:

    [data-toggle="buttons"] > .btn input[type="radio"],
    [data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
    [data-toggle="buttons"] > .btn input[type="checkbox"],
    [data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
      position: absolute;
      clip: rect(0, 0, 0, 0);
      pointer-events: none;
    }

    【2.】 用来传递替换文本(不知道是不是这么说),见下面的例子:

    input[type=checkbox].ace.ace-switch + .lbl[data-lbl]::before {
      content: attr(data-lbl);
    }

    转摘: https://segmentfault.com/q/1010000004043423

    展开全文
  • Column toggle

    2020-12-02 22:40:10
    <div><p>Could you implement column toggle please ? <p>Just something similar to the column toggle demo from the link below <p>http://filamentgroup.github.io/tablesaw/demo/toggle.html</p><p>该提问来源...
  • Toggle isn't really a toggle

    2020-12-09 01:10:01
    <div><p>The <code>keyboard toggle</code> command doesn't toggle the state of the led. You have to specify if you want to turn it off or on: it's a set, not a toggle. Can you add an option to ...
  • Toggle compass

    2021-01-12 01:59:12
    <p>toggle compass on/off with default key "?" <h4>Summary <pre><code>SUMMARY: Interface "toggle compass"</code></pre> <h4>Purpose of change <p>for those with small resolution, it is ...
  • Toggle issue

    2021-01-06 18:26:47
    <p>The <code>toggle</code> widget doesn't really do what it does : it just checks, when enabled, that a facet is true. However, there is no way to toggle it to false, making its behaviour ...
  • Toggle pw

    2020-12-09 04:18:10
    Adds toggle pw to password fields (and secret keys, etc) Optionally, all of these buttons can be removed or restored in 'Web Interfaces Preferences' In this branch, the toggle button has been ...
  • Toggle splits

    2020-12-05 11:34:07
    <div><p>Adds a new button in the accounts views to toggle the visibility of ALL split transactions. This is a <em>global</em> toggle. <p>http://i.imgur.com/sfGHxmS.png</p><p>该提问来源于开源项目ÿ...
  • Easy toggle

    2020-12-26 09:45:36
    toggleElement(element to toggle (jQuery selector), the item that toggles it (jQuery selector), any image options (see below), the duration of the animation (string or int)) <p>toggleElementEvent is ...
  • Toggle columns

    2020-11-27 17:37:49
    <p>Is there a way to toggle columns visibility ? Like having a list of all possible columns, with a checkbox for each, that would allow to hide / show ? I quickly searched in the Columns part of the ...
  • ghost toggle

    2020-12-02 00:50:29
    <div><p>In blender the only way i know how to toggle ghost is to parent it to a dumby object in the scene and set it to ghost. Then to un ghost it i just unparent it. Any chance of the ghosting being ...
  • Style Toggle

    2020-12-25 19:48:11
    <div><p>I added the ability to toggle between the original css and my css. <p>I took out the things that I set up for my personal use (like removing the browser support comments and the restyling of ...
  • Toggle menuitems

    2020-11-29 02:30:44
    <div><h3>feat(js): adds param to menuitem to toggle other menu items <p>fixes #8158 <p>BREAKING CHANGE: Toggleable menu items are no longer registered with elgg.ui.registerTogglableMenuItems. Use a &#...
  • 问题描述:有AB两组toggle,共用同一个togglegroup,当A或者B中任意一toggle的isOn=true时,setactive(false)另外一组toggle。常理来讲,如果被false的那组toggle中包含isOn=true的toggletogglegroup会给他关掉...

    今天在用ugui做二级菜单的时候发现一个问题。
    问题描述:有AB两组toggle,共用同一个togglegroup,当A或者B中任意一toggle的isOn=true时,setactive(false)另外一组toggle。常理来讲,如果被false的那组toggle中包含isOn=true的toggle,togglegroup会给他关掉,但实际上并没有。

    最后找到unity的一个帖子有一位网友提供了一个解决方法,做了一个扩展的toggle,下面是代码,最下面是帖子地址。

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;
     public class ToggleEx : Toggle
        {
            private struct Group
            {
                public HashSet<ToggleEx> onToggles;
                public HashSet<ToggleEx> offToggles;
            }
     
            private static Dictionary<ToggleGroup, Group> __groups;
     
            private bool __isOn;
            private ToggleGroup __group;
     
            protected override void Awake()
            {
                base.Awake();
     
                __isOn = isOn;
     
                ToggleGroup group = base.group;
                if (group != null)
                {
                    __group = group;
     
                    __Add();
                }
     
                if (onValueChanged == null)
                    onValueChanged = new ToggleEvent();
     
                onValueChanged.AddListener(__Update);
            }
     
            protected override void OnEnable()
            {
                if (!__isOn && __group != null)
                {
                    Group group;
                    if (__groups != null && __groups.TryGetValue(__group, out group) && group.onToggles != null)
                    {
                        foreach (ToggleEx toggle in group.onToggles)
                            __group.RegisterToggle(toggle);
                    }
                }
     
                base.OnEnable();
            }
     
            protected override void OnDisable()
            {
                if (__isOn && __group != null)
                {
                    Group group;
                    if (__groups != null && __groups.TryGetValue(__group, out group) && group.offToggles != null)
                    {
                        foreach (ToggleEx toggle in group.offToggles)
                            __group.UnregisterToggle(toggle);
                    }
                }
     
                base.OnDisable();
            }
     
            protected override void OnDestroy()
            {
                __Remove();
     
                base.OnDestroy();
            }
     
            private void __Add()
            {
                if (__group == null)
                    return;
     
                if (__groups == null)
                    __groups = new Dictionary<ToggleGroup, Group>();
     
                Group group;
                __groups.TryGetValue(__group, out group);
     
                if (__isOn)
                {
                    if (group.onToggles == null)
                        group.onToggles = new HashSet<ToggleEx>();
     
                    group.onToggles.Add(this);
     
                    __groups[__group] = group;
                }
                else
                {
                    if (group.offToggles == null)
                        group.offToggles = new HashSet<ToggleEx>();
     
                    group.offToggles.Add(this);
     
                    __groups[__group] = group;
                }
            }
     
            private void __Remove()
            {
                if (__group == null)
                    return;
     
                if (__groups == null)
                    __groups = new Dictionary<ToggleGroup, Group>();
     
                Group group;
                __groups.TryGetValue(__group, out group);
     
                if (__isOn)
                {
                    if (group.onToggles != null)
                        group.onToggles.Remove(this);
     
                    __groups[__group] = group;
                }
                else
                {
                    if (group.offToggles != null)
                        group.offToggles.Remove(this);
     
                    __groups[__group] = group;
                }
            }
     
            private void __Update(bool value)
            {
                __Remove();
     
                __isOn = value;
     
                __group = group;
     
                __Add();
            }
        }
    

    帖子地址,点我访问

    展开全文
  • Toggle functionality

    2020-12-09 12:58:47
    However, for a more minimal version I would love to be able to toggle each option on and off / setting each to true or false. For some elements I can do a workaround by customizing the CSS, for ...
  • Toggle layout

    2020-12-28 19:02:41
    <div><p>Hi, can you add toggle layout</p><p>该提问来源于开源项目:David-Desmaisons/Vue.Isotope</p></div>
  • Toggle openDrawer

    2020-12-08 22:43:41
    <div><p>what command do I need to run openDrawer on to toggle it?</p><p>该提问来源于开源项目:Tinysymphony/react-native-drawer-menu</p></div>
  • Toggle sidebar

    2020-12-06 06:52:47
    <div><p>It would be nice if the user could toggle the visibility of the sidebar. Sometimes the extra horizontal space is nice.</p><p>该提问来源于开源项目:tentone/nunuStudio</p></div>
  • Otherwise if you take showOrHide at its word, it would do nothing if you pass false and would call the regular toggle() if you pass true ;-)</p><p>该提问来源于开源项目:jquery/api.jquery....
  • toggle transparancy

    2020-12-25 21:19:34
    <div><p>remove the default transparent objects.... Would be nice to toggle transparancy, but not by default.</p><p>该提问来源于开源项目:opensourceBIM/BIMsurfer-before2019</p></div>
  • Toggle icon

    2020-12-09 15:39:04
    <div><h1>88 Here is my example of toggle icon component. I think this not fully ready, so i am open to ur suggestions.</h1><p>该提问来源于开源项目:nvms/vue-atlas</p></div>
  • Toggle node

    2020-12-05 12:56:14
    <div><p>I want an option to toggle collapse node by click (or double click) on the node title. Is this possible? Thank you.</p><p>该提问来源于开源项目:mbraak/jqTree</p></div>
  • Checkbox toggle

    2020-12-25 18:44:14
    <div><p>It was necessary remove the table checkbox functionality and create a new checkbox toggle module to increase it use to many different scenarios. <p>close #1375</p><p>该提问来源于开源项目ÿ...
  • toggle switch

    2014-07-18 10:13:28
    eton toggle switch, very usefully

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 32,864
精华内容 13,145
关键字:

toggle