Actions

API16

JHtmlBehavior/switcher

From Joomla! Documentation

< API16:JHtmlBehavior
Revision as of 16:51, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

[Edit Descripton]

Description:JHtmlBehavior/switcher

Contents

Syntax

static switcher()


Defined in

libraries/joomla/html/html/behavior.php

Importing

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

Source Body

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);
}

[Edit See Also] SeeAlso:JHtmlBehavior/switcher

Examples

<CodeExamplesForm />