Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript optgroup (parent/child relationships)

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #42715
    jbarriosmm
    Member

    i need to makes optgroups in the select based on the parent/child relationships

    when i look my web at smartphone or tablet… i cant see a separation for father menu. (www.benditaflor.cl)

    how can i make this visual variation?

    _Actually code in scripts.js is:_

    // Create the dropdown base
    jQuery(““).appendTo(“#main-menu-wrapper”);

    // Create default option “Go to…”
    jQuery(““, {
    “selected”: “selected”,
    “value” : “”,
    “text” : goText
    }).appendTo(“#main-menu-wrapper select”);

    // Populate dropdown with menu items
    jQuery(“#main-menu a”).each(function() {
    var el = jQuery(this);
    jQuery(““, {
    “value” : el.attr(“href”),
    “text” : el.text()
    }).appendTo(“#main-menu-wrapper select”);
    });

    // To make dropdown actually work
    jQuery(“#main-menu-wrapper select”).change(function() {
    window.location = jQuery(this).find(“option:selected”).val();
    });

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.