Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей.
Здесь обсуждаются безопасность, программирование, технологии и многое другое.
Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
 |
конфликт jquery $ и mootools $ |

06.01.2010, 00:16
|
|
Участник форума
Регистрация: 28.07.2007
Сообщений: 177
Провел на форуме: 274360
Репутация:
5
|
|
конфликт 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 )
|
|
|

06.01.2010, 01:18
|
|
Постоянный
Регистрация: 30.08.2007
Сообщений: 773
Провел на форуме: 3069349
Репутация:
808
|
|
>>
Код:
jQuery.noConflict();
jQuery(function(){
|
|
|

06.01.2010, 02:21
|
|
Участник форума
Регистрация: 28.07.2007
Сообщений: 177
Провел на форуме: 274360
Репутация:
5
|
|
Сообщение от astrologer
>>
Код:
jQuery.noConflict();
jQuery(function(){
спасибо!  коротко и ясно
|
|
|
|
 |
Похожие темы
|
| Тема |
Автор |
Раздел |
Ответов |
Последнее сообщение |
|
Уроки создания фишек для сайта по методам jQuery
|
Dagert |
PHP, PERL, MySQL, JavaScript |
2 |
23.12.2009 16:24 |
|
Конфликт с разработчиками Skype улажен мирным путем
|
Keltos |
Мировые новости |
0 |
07.11.2009 12:48 |
|
jquery javasript vs php
|
barnaki |
PHP, PERL, MySQL, JavaScript |
4 |
03.06.2009 11:21 |
|
jquery
|
barnaki |
PHP, PERL, MySQL, JavaScript |
5 |
26.05.2009 14:06 |
|
jQuery
|
procedure |
PHP, PERL, MySQL, JavaScript |
3 |
01.05.2009 14:20 |
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|