API16

JHtmlBehavior/switcher

From Joomla! Documentation

< API16:JHtmlBehavior
Revision as of 20:45, 24 March 2017 by JoomlaWikiBot (talk | contribs) (preparing for archive only)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

<! removed transcluded page call, red link never existed >

Syntax[edit]

static switcher()


Defined in[edit]

libraries/joomla/html/html/behavior.php

Importing[edit]

jimport( 'joomla.html.html.behavior' );

Source Body[edit]

public static function switcher()
{
        JHtml::_('behavior.framework');
        JHTML::_('script','system/switcher.js', false, true);

        $script = "
                document.switcher = null;
                window.addEvent('domready', function(){
                        toggler = document.id('submenu')
                        element = document.id('config-document')
                        if(element) {
                                document.switcher = new JSwitcher(toggler, element, {cookieName: toggler.getAttribute('class')});
                        }
                });";

        JFactory::getDocument()->addScriptDeclaration($script);
}


<! removed transcluded page call, red link never existed >

Examples[edit]

Code Examples[edit]