我需要帮助来定位我的代码中的冲突,下面是我丑陋的代码(我刚刚开始编写我的 mootools 并且我认为我的方法很丑陋)。该网站可以在这里看到http://tinyurl.com/y9xvm6b。我认为它与这些线相冲突
<script type="text/javascript" src="/lotsforsaleroxascity/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/lotsforsaleroxascity/media/system/js/caption.js"></script>
在我的代码中。那 2 行是由我的 cms 生成并使用它。
// Global Functions
window.addEvent('domready',function(){
/* ------------------------------------------------------- Menu */
var Logo = $('logo').getElements('a'),
LogoPos = Logo.getStyle('backgroundPosition');
Logo.addEvents({
mouseenter: function(){
this.fade(1);
},
mouseleave: function(){
// Morphes back to the original style
this.fade(0);
}
});
/* ------------------------------------------------------- Tabs */
var tabs = new MGFX.Tabs('#foliobotnav .nav','.t1',{
autoplay: true,
transitionDuration:500,
slideInterval:6000,
hover:true
});
var pages = new noobSlide({
box: $('mcontent_hold'),
items: $$('#mcontent_hold div'),
size: 950,
handles: $$('#logo a').extend($$('#topnav ul li.inpage a')),
onWalk: function(currentItem,currentHandle){
<!--$('info4').set('html',currentItem.getFirst().innerHTML);-->
this.handles.removeClass('active');
currentHandle.addClass('active');
}
});
/* ------------------------------------------------------- Websites */
var dropWEB = $$('#web div.left div.imgwrap')[0];
$$('#web .right .imgwrap').each(function(item)
{
item.addEvent('click', function(e)
{
e = new Event(e).stop();
dropWEB.removeEvents();
dropWEB.empty()
var a = item.clone();
a.inject(dropWEB);
dropWEB.style.height = "400px";
});
});
/* ------------------------------------------------------- Websites End*/
/* ------------------------------------------------------- Identity */
var dropID = $$('#artwork div.left div.imgwrap')[0];
$$('#artwork .right .imgwrap').each(function(item)
{
item.addEvent('click', function(e)
{
e = new Event(e).stop();
dropID.removeEvents();
dropID.empty()
var a = item.clone();
a.inject(dropID);
dropID.style.height = "400px";
});
});
/* ------------------------------------------------------- Identity End*/
/* ------------------------------------------------------- Artworks */
var dropART = $$('#identity div.left div.imgwrap')[0];
$$('#identity .right .imgwrap').each(function(item)
{
item.addEvent('click', function(e)
{
e = new Event(e).stop();
dropART.removeEvents();
dropART.empty()
var a = item.clone();
a.inject(dropART);
dropART.style.height = "400px";
});
});
/* ------------------------------------------------------- Artworks End*/
/* ------------------------------------------------------- Contact */
$("form").submit(function(){
// 'this' refers to the current submitted form
var str = $(this).serialize();
$.ajax({
type: "POST",
url: "contact.php",
data: str,
success: function(msg){
$("#msg").ajaxComplete(function(event, request, settings){
if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
{
result = '<div class="notification_ok">Your message has been sent. Thank you!</div>';
$("#formwrap").hide();
}
else
{
result = msg;
}
$(this).html(result);
});
}
});
return false;
});
/* ------------------------------------------------------- Contact */
});
谢谢你!
---编辑如下
顺便说一句,我遇到的冲突是我在 globals.js 中的所有自定义函数都不起作用。按钮不起作用,滑块不起作用,缩略图查看器也不起作用。
再次感谢。