ANTICHAT Forum
HOME FORUMS MEMBERS RECENT POSTS LOG IN  
Баннер 1   Баннер 2
НОВЫЕ ТОРГОВАЯ НОВОСТИ
loading...
Скрыть
Вернуться   ANTICHAT > ПРОГРАММИРОВАНИЕ > PHP
   
Ответ
 
Опции темы Поиск в этой теме Опции просмотра

конфликт jquery $ и mootools $
  #1  
Старый 06.01.2010, 00:16
ufalog
Участник форума
Регистрация: 28.07.2007
Сообщений: 177
С нами: 9888748

Репутация: 5
Red face конфликт jquery $ и mootools $

PHP код:
<script type="text/javascript" src="/media/system/js/mootools.js"></script>
  <
script type="text/javascript" src="/media/system/js/caption.js"></script>
  <
script type="text/javascript" src="/modules/mod_accordionmenu/assets/accordionmenu.js"></script> 

PHP код:

<script src='/templates/wmt/js/jquery.js' type='text/javascript'></script>
<
script src='/templates/wmt/js/jquery.cross-slide.js' type='text/javascript'></script>
<
script src='/templates/wmt/js/mootools.js' type='text/javascript'></script> 
jquery.js и jquery.cross-slide.js используеться в -------->

PHP код:
<script type='text/javascript'>
jQuery(jQuery() {
jQuery('#test1').crossSlide({
  
fade: 1
}, [
  {
    
src:  'http://spb.ufasearch.ru/templates/wmt/images/gorod/spb/1.jpg',
    
from: '100% 100% 1x',
    
to:   '100% 100% 1x',
    
time: 4
  
}, {
    
src:  'http://spb.ufasearch.ru/templates/wmt/images/gorod/spb/2.jpg',
    
from: '100% 100% 1x',
    
to:   '100% 100% 1x',
    
time: 4
  
}, 
  
    {
    
src:  'http://spb.ufasearch.ru/templates/wmt/images/gorod/spb/3.jpg',
     
from: '100% 100% 1x',
    
to:   '100% 100% 1x',
    
time: 4
  
},
  
  {
    
src:  'http://spb.ufasearch.ru/templates/wmt/images/gorod/spb/4.jpg',
     
from: '100% 100% 1x',
    
to:   '100% 100% 1x',
    
time: 4
  
}, {
    
src:  'http://spb.ufasearch.ru/templates/wmt/images/gorod/spb/5.jpg',
     
from: '100% 100% 1x',
    
to:   '100% 100% 1x',
    
time: 4
  
}
]);
});
</
script>


<
div id='test1'>Loading...</div> 
mootools.js -----------------------> используеться mod_accordionmenu

там есть accordionmenu.js
PHP код:


function accordionMenu(menuId, srcExpandImage, srcCollapseImage, accOptions, accHoverDelay, bDoHover) {
if($(
menuId)){

    
// getting accordion parent items ("li" tags with class "parent")
    
$(menuId).accParentItems = [];

    for(var 
i = 0; i < $(menuId).childNodes.length; i++) {

        if($(
menuId).childNodes[i].className.indexOf('parent') >= 0){
            $(
menuId).accParentItems.push($(menuId).childNodes[i]);
        }
    }


    $(
menuId).accTogglers = [];
    $(
menuId).accElements = [];
    var 
startItem = -1;

    for(var 
i = 0; i < $(menuId).accParentItems.length; i++) {

        if(
srcExpandImage.length > 0){

            
// creating accordion togglers
            
var accToggler = document.createElement("img");
    
            
accToggler.setAttribute("title","Expand");
            
accToggler.setAttribute("src",srcExpandImage);
        }
        else
        {
            var 
accToggler = document.createElement("span");    
        }
            $(
menuId).accParentItems[i].insertBefore(accToggler, $(menuId).accParentItems[i].firstChild);
        
            $(
menuId).accTogglers.push(accToggler);
        

        
// accordion elements
        
$(menuId).accElements.push($(menuId).accParentItems[i].getElementsByTagName('ul')[0]);

        
// searching for active menu item to make the accordion show its sub-items when page loads
        
if ( $(menuId).accParentItems[i].className.indexOf('active') >= 0 ) {
            
startItem = i;
        }
   }

    
//create our Accordion instance
    
if ( $(menuId).accParentItems.length > 0 ){
        $(
menuId).Accordion = new Accordion($(menuId).accTogglers, $(menuId).accElements, $merge({
            
opacity: false,
            
alwaysHide: true,
            
show: startItem,
            
duration: 600,
            
transition: Fx.Transitions.Bounce.easeOut,

            
onActive: function(toggler, element){
                
element.parentNode.parentNode.setStyle('height', 'auto');
                
toggler.setAttribute("src", srcCollapseImage);
                
toggler.setAttribute("title","Collapse");
            },
            
onBackground: function(toggler, element){
                
element.parentNode.parentNode.setStyle('height', 'auto');
                
element.setStyle('height', element.offsetHeight+'px');
                
toggler.setAttribute("src", srcExpandImage);
                
toggler.setAttribute("title","Expand");
            }

            }, 
accOptions)

        );
    }


    
accTimer = null;
    if (!
accHoverDelay) var accHoverDelay = 200;
    
    for(var 
i = 0; i < $(menuId).accParentItems.length; i++) {

        eval(
"function accOnclickFunc(){return function(){ if( $('"+menuId+"').accElements["+i+"].style.height == '0px' ) { $('"+menuId+"').Accordion.display("+i+") }}}");
        eval(
"function accOnMouseoverFunc(){return function(){if( $('"+menuId+"').accElements["+i+"].style.height == '0px' ){accTimer = $('"+menuId+"').Accordion.display.delay("+accHoverDelay+", $('"+menuId+"').Accordion, "+i+");}}}");
        eval(
"function accOnmouseoutFunc(){return function(){if($defined(accTimer)){$clear(accTimer);}}}");

        $(
menuId).accParentItems[i].firstChild.nextSibling.onclick = accOnclickFunc();
        if (
bDoHover==1) {
            $(
menuId).accParentItems[i].firstChild.nextSibling.onmouseover = accOnMouseoverFunc();
        }
        $(
menuId).accParentItems[i].firstChild.nextSibling.onmouseout = accOnmouseoutFunc();
    }


    for(var 
i = 0; i < $(menuId).accElements.length; i++) {
        $(
menuId).accElements[i].setAttribute('id', menuId+'_'+i);
        
accordionMenu(menuId+'_'+i, srcExpandImage, srcCollapseImage, accOptions, accHoverDelay, bDoHover)
    }

}
} 

счас на http://ufasearch.ru/index.php работает тока менюшка на mootools/// а галерея на основе jquery не работает!!! (работу можно посмотреть на сайте rostov.ufasearch.ru )
 
Ответить с цитированием

  #2  
Старый 06.01.2010, 01:18
astrologer
Постоянный
Регистрация: 30.08.2007
Сообщений: 773
С нами: 9840758

Репутация: 808


По умолчанию

Код:
jQuery(jQuery() {
>>
Код:
jQuery.noConflict();
jQuery(function(){
 
Ответить с цитированием

  #3  
Старый 06.01.2010, 02:21
ufalog
Участник форума
Регистрация: 28.07.2007
Сообщений: 177
С нами: 9888748

Репутация: 5
По умолчанию

Цитата:
Сообщение от astrologer  
Код:
jQuery(jQuery() {
>>
Код:
jQuery.noConflict();
jQuery(function(){
спасибо! коротко и ясно
 
Ответить с цитированием
Ответ



Предыдущая тема Следующая тема
Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Уроки создания фишек для сайта по методам jQuery Dagert PHP 2 23.12.2009 16:24
Конфликт с разработчиками Skype улажен мирным путем Keltos Мировые новости. Обсуждения. 0 07.11.2009 12:48
jquery javasript vs php barnaki PHP 4 03.06.2009 11:21
jquery barnaki PHP 5 26.05.2009 14:06
jQuery procedure PHP 3 01.05.2009 14:20



Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 


Быстрый переход




ANTICHAT ™ © 2001- Antichat Kft.