благодарю за внимание, по пункту №3
заменил spnoConflict на jQuery и появилась ошибка Uncaught ReferenceError: spnoConflict is not defined (anonymous function) со ссылкой на этот код в index.html <script src="/templates/shaper_maxima/js/fixed-menu.js" type="text/javascript"></script> вот сам код fixed-menu.js jQuery(function($){ $(window).on('scroll', function(){ if( $(window).scrollTop()>205 ){ $('#sp-menu-wrapper').addClass('menu-fixed'); } else { $('#sp-menu-wrapper').removeClass('menu-fixed'); } }); $('.sp-main-menu-toggler').on('click', function(e){ e.preventDefault(); }); $('.sp-main-menu-toggler').appendTo('#sp-menu'); $('.sp-mobile-menu').appendTo('#menu'); }); меню на сайте не работает p.s. убрал мусор в 39 строке, отказало главное меню (пробовал еще до переноса jquery-noconflict.js ниже) этот мусор генерирует menu.php с кодом <?php /** * @package Helix Framework * @author JoomShaper [url]http://www.joomshaper.com[/url] * @copyright Copyright (c) 2010 - 2015 JoomShaper * @license [url]http://www.gnu.org/licenses/gpl-2.0.html[/url] GNU/GPLv2 or Later */ //no direct accees defined ('_JEXEC') or die('resticted aceess'); class HelixFeatureMenu { private $helix; public function __construct($helix){ $this->helix = $helix; } public function onHeader() { if ($this->helix->megaMenuType()=='drop') { $this->helix->addCSS('dropline.css'); $this->helix->addJS('dropline.js'); } elseif($this->helix->megaMenuType()=='split') { $this->helix->addCSS('dropline.css'); } else { $this->helix->addJS('menu.js'); } $this->helix->addCSS('mobile-menu.css'); } public function onFooter() { ob_start(); ?> <a class="hidden-desktop btn btn-inverse sp-main-menu-toggler" href="#" data-toggle="collapse" data-target=".nav-collapse"> <i class="icon-align-justify"></i> </a> <div class="hidden-desktop sp-mobile-menu nav-collapse collapse"> <?php $mobilemenu = $this->helix->loadMobileMenu(); echo $mobilemenu->showMenu(); ?> </div> <?php return ob_get_clean(); } public function Position() { return 'menu'; } public function onPosition() { $menu = $this->helix->loadMegaMenu(); if ($menu) { ob_start(); ?> <div id="sp-main-menu" class="visible-desktop"> <?php echo $menu->showMenu(); ?> </div> <?php if (($this->helix->megaMenuType()=='split') && $menu->hasSub() || $this->helix->megaMenuType()=='drop') { if($this->helix->megaMenuType()=='drop'){ $newclass = 'dropline empty '; } else{ $newclass = 'split '; } echo '<div id="sublevel" class="' . $newclass . 'visible-desktop"><div class="container">'; $menu->showMenu(1); echo '</div></div>'; } if (($this->helix->megaMenuType()=='split' && $menu->hasSub()) || $this->helix->megaMenuType()=='drop') { $sublevel=1; } else { $sublevel=0; } if (($this->helix->megaMenuType()=='split') && $menu->hasSub() || $this->helix->megaMenuType()=='drop') { if($this->helix->megaMenuType()=='drop') { $this->helix->addInlineJS("spnoConflict(function($){ function mainmenu() { $('#sp-main-menu').droplinemenu({ sublevelContainer:$('#sublevel > div') }); } mainmenu(); $(window).on('resize',function(){ mainmenu(); }); });"); } } else { $this->helix->addInlineJS("spnoConflict(function($){ function mainmenu() { $('.sp-menu').spmenu({ startLevel: 0, direction: '" . $this->helix->direction() . "', initOffset: { x: ".$this->helix->Param('init_x',0).", y: ".$this->helix->Param('init_y',0)." }, subOffset: { x: ".$this->helix->Param('sub_x',0).", y: ".$this->helix->Param('sub_y',0)." }, center: ".$this->helix->Param('submenu_position',0)." }); } mainmenu(); $(window).on('resize',function(){ mainmenu(); }); });"); } return ob_get_clean(); } } } |
VideoProm,
с php не смогу помочь, нужен другой специалист. |
спасибо за совет, уже ищу php специалиста, но помогите пжлста по js, я следуя вашим советам заменил spnoConflict на jQuery и появилась ошибка Uncaught ReferenceError: spnoConflict is not defined (anonymous function) со ссылкой на этот код в index.html
<script src="/templates/shaper_maxima/js/fixed-menu.js" type="text/javascript"></script> вот сам код fixed-menu.js jQuery(function($){ $(window).on('scroll', function(){ if( $(window).scrollTop()>205 ){ $('#sp-menu-wrapper').addClass('menu-fixed'); } else { $('#sp-menu-wrapper').removeClass('menu-fixed'); } }); $('.sp-main-menu-toggler').on('click', function(e){ e.preventDefault(); }); $('.sp-main-menu-toggler').appendTo('#sp-menu'); $('.sp-mobile-menu').appendTo('#menu'); }); |
VideoProm,
строку 75 <script src="/plugins/system/helix/js/jquery-noconflict.js" type="text/javascript"></script> перенесите в строку 30 spnoConflict у вас формируется в 70 строке , а начинает использоваться в 37 !!! сколько раз писать Цитата:
|
Часовой пояс GMT +3, время: 14:21. |