Jump to content

jeece76

Members
  • Posts

    90
  • Joined

Reputation Activity

  1. Like
    jeece76 reacted to Rikki for a guide, ips.ui.hovercard   
    Description
    The hovercard widget can be used to display a popup with remote content, which is attached to a trigger element.
     
    Example
    @todo
     
    Usage
    The hovercard widget is initialized by including the widget key attribute on a link:
    <a href='...' data-ipsHover>Hover on me</a> The URL that the link points to is also the URL that is called to fetch the hovercard content, by default.
     
    Options
    target
    (String; optional)
    If a URL other than the link's href should be used to load the hovercard content, it can be specified in this option.
     
    content
    (Mixed; optional)
    Sets the content of the hovercard. If a selector is provided, the contents of the matching element will be inserted into to hovercard. Alternatively, a string can be supplied which will be inserted into the hovercard. Using this option means remote content won't be loaded by the hovercard.
     
    timeout
    (Number; optional; default 0.75)
    The number of seconds between the user hovering on the element and the hovercard beginning to load (and conversely, hiding when the mouse leaves the element).
     
    attach
    (Selector; optional)
    The element that the hovercard will be attached to. If not specified, the element that the widget is initialized on will be used.
     
    width
    (Number; optional; default 300)
    The width in pixels at which the hovercard will display.
     
    onClick
    (Boolean; optional; default false)
    If true, the hovercard will be activated only when the user clicks on the element. By default, the hovercard will show on hover.
     
     
  2. Like
    jeece76 reacted to Rikki for a guide, Dropdown Menus   
    Description
    Dropdown menus allow users to select from a number of options. The markup is designed to work in tandem with the ips.ui.menu javascript module.
     
    Usage
    A menu consists of a trigger element, and the menu element itself:
    <!-- The trigger --> <a href='#elMyMenu_menu' id='elMyMenu'>Open Menu</a> <!-- The menu --> <ul id='elMyMenu_menu' class='ipsMenu'> ... </ul> The ID of the menu should be the ID of the trigger element, suffixed by _menu. If the trigger element is a link, its href should be an anchor to the ID of the menu element. This makes the menu accessible even when Javascript is disabled in the browser.
     
    Basic menu
    A basic menu might have the following markup:
    <ul class='ipsMenu ipsHide'> <li class='ipsMenu_item'><a href='#'>Item 1</a></li> <li class='ipsMenu_item'><a href='#'>Item 2</a></li> <li class='ipsMenu_item'><a href='#'>Item 3</a></li> <li class='ipsMenu_sep'><hr></li> <li class='ipsMenu_item'><a href='#'>Item 4</a></li> <li class='ipsMenu_item'><a href='#'>Item 5</a></li> </ul> This would display as follows: see example.
    Item 1 Item 2 Item 3 Item 4 Item 5 ipsMenu is the base class for the menu element. Items within the menu should have the class ipsMenu_item, with the link element inside of that. A separator item can be added by giving the item the class ipsMenu_sep, containing an <hr> element.
    Note that the positioning and stem is added automatically by the menu javascript module; it does not need to be manually specified. The stem can be removed, if necessary, by including the class ipsMenu_noStem on the menu element.
     
    Disabling menu items
    Individual menu items can be disabled by adding the class ipsMenu_itemDisabled to the list item: see example.
    Item 1 Disabled Item 2 Item 3 Note: Disabled items are not foolproof; in browsers that do not support the CSS pointer-events style, a click on a disabled item will still register. Ensure your javascript properly deals with disabled item clicks if necessary.
     
    Menu sizing
    By default, a menu will have no defined width. An additional classname can be specified on the menu element to determine how wide it should display.
    ipsMenu_auto - menu will appear as wide as necessary, though with a minimum width of 200px and a maximum width of 500px ipsMenu_narrow - 200 pixels wide ipsMenu_normal - 300 pixels wide ipsMenu_wide - 450 pixels wide  
    Selectable menus
    A selectable menu allows the user to toggle one or more of the menu items, useful for turning options on and off. For this functionality to work, the javascript module needs to be used.
    A menu can be made selectable by adding the classname ipsMenu_selectable. A menu item can be shown as selected by adding the classname ipsMenu_itemChecked to the list item.
    The markup for a selectable menu might look this:
    <ul id='elMenu2_menu' class='ipsMenu ipsMenu_normal ipsMenu_selectable ipsHide'> <li class='ipsMenu_item'><a href='#'>Item 1</a></li> <li class='ipsMenu_item ipsMenu_itemChecked'><a href='#'>Item 2</a></li> <li class='ipsMenu_item'><a href='#'>Item 3</a></li> </ul> This would display as follows: see example.
    Item 1 Item 2 Item 3  
    Sub-menus
    Submenus can be created by embedding menus within one another. To do so, simply include the ipsMenu_subItems class on the item that contains the submenu, and the submenu itself within the item. For example:
    <ul id='elMenu3_menu' class='ipsMenu ipsMenu_normal ipsHide'> <li class='ipsMenu_item'> <a href='#'>Item 1 (no children)</a> </li> <li class='ipsMenu_item ipsMenu_subItems'> <a href='#'>Item 2 (with children)</a> <ul class='ipsMenu ipsMenu_wide ipsHide'> <li class='ipsMenu_item'><a href='#'>Sub Item 1</a></li> <li class='ipsMenu_item'><a href='#'>Sub Item 2</a></li> <li class='ipsMenu_item'><a href='#'>Sub Item 3</a></li> </ul> </li> </ul> This would display as follows: see example.
    Item 1 (no children) Item 2 (with children) Sub Item 1 Sub Item 2 Sub Item 3  
×
×
  • Create New...