API16

JHtmlBehavior/switcher: Difference between revisions

From Joomla! Documentation

m clean up
m preparing for archive only
 
Line 35: Line 35:


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=switcher
  category=switcher
  category=JHtmlBehavior
  category=JHtmlBehavior
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 01:45, 25 March 2017

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

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


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

Examples

Code Examples