本文整理汇总了PHP中JHTML::getJSObject方法的典型用法代码示例。如果您正苦于以下问题:PHP JHTML::getJSObject方法的具体用法?PHP JHTML::getJSObject怎么用?PHP JHTML::getJSObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JHTML
的用法示例。
在下文中一共展示了JHTML::getJSObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _loadBehavior
/**
* Load the JavaScript behavior.
*
* @param string $group The pane identifier.
* @param array $params Array of options.
*
* @return void
*
* @since 11.1
*/
protected static function _loadBehavior($group, $params = array())
{
static $loaded = array();
if (!array_key_exists($group, $loaded)) {
// Get the JInput object
$input = JFactory::getApplication()->input;
$loaded[$group] = true;
// Include mootools framework.
JHtml::_('behavior.framework', true);
$document = JFactory::getDocument();
$display = isset($params['startOffset']) && isset($params['startTransition']) && $params['startTransition'] ? (int) $params['startOffset'] : null;
$show = isset($params['startOffset']) && !(isset($params['startTransition']) && $params['startTransition']) ? (int) $params['startOffset'] : null;
$opt['onActive'] = "\\function(toggler, i) {toggler.addClass('pane-toggler-down');" . "toggler.removeClass('pane-toggler');i.addClass('pane-down');i.removeClass('pane-hide');Cookie.write('jpanesliders_" . $group . "',\$\$('div#" . $group . ".pane-sliders > .panel > h3').indexOf(toggler));}";
$opt['onBackground'] = "\\function(toggler, i) {toggler.addClass('pane-toggler');" . "toggler.removeClass('pane-toggler-down');i.addClass('pane-hide');i.removeClass('pane-down');if(\$\$('div#" . $group . ".pane-sliders > .panel > h3').length==\$\$('div#" . $group . ".pane-sliders > .panel > h3.pane-toggler').length) Cookie.write('jpanesliders_" . $group . "',-1);}";
$opt['duration'] = isset($params['duration']) ? (int) $params['duration'] : 300;
$opt['display'] = isset($params['useCookie']) && $params['useCookie'] ? $input->cookie->get('jpanesliders_' . $group, $display, 'integer') : $display;
$opt['show'] = isset($params['useCookie']) && $params['useCookie'] ? $input->cookie->get('jpanesliders_' . $group, $show, 'integer') : $show;
$opt['opacity'] = isset($params['opacityTransition']) && $params['opacityTransition'] ? 'true' : 'false';
$opt['alwaysHide'] = isset($params['allowAllClose']) && !$params['allowAllClose'] ? 'false' : 'true';
$options = JHTML::getJSObject($opt);
$js = "window.addEvent('domready', function(){ new Fx.Accordion(\$\$('div#" . $group . ".pane-sliders > .panel > h3.pane-toggler'), \$\$('div#" . $group . ".pane-sliders > .panel > div.pane-slider'), " . $options . "); });";
$document->addScriptDeclaration($js);
}
}