mootools 手风琴不工作
我一直想在mootools上尝试一下手风琴效果,但我无法让它工作,就像js根本没有加载
这是HTML代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>BarDiJan - We Deliver</title>
<link rel="stylesheet" href="/stylesheets/reset.css" type="text/css" />
<link rel="stylesheet" href="/stylesheets/style.css" type="text/css" />
<script type="text/javascript" src="/javascripts/mootools-core-1.3-accordion.js"></script>
<script type="text/javascript" src="/javascripts/mootools-more.js"></script>
<script type="text/javascript" src="/javascripts/application.js"></script>
</head>
<body>
<div class="container">
<div id="accordion">
<h3 class="toggler">What we Do</h3>
<div class="element">
<p>We are people who deliver professional quality identity to you, we have wide range of support.
</p>
</div>
<h3 class="toggler">What we Did</h3>
<div class="element">
<p>Under Construction</p>
</div>
<h3 class="toggler">What we Offer</h3>
<div class="">
<ul>
<li>Web Design</li>
<li>Identity</li>
</ul>
</div>
</div>
</div>
</body>
</html>
这是application.js代码
windows.addEvent('domready', function() {
var accordion = new Accordion($$('h3.toggler'),$$('div.element'), {
display: 2,
opacity: false,
alwaysHide: true,
onActive: function(toggler) { toggler.setStyle('color', '#929292'); },
onBackground: function(toggler) { toggler.setStyle('color', '#000000'); }
});
});
有什么吗我做错了吗?如果重要的话我也会使用 sinatra。
也感谢您的宝贵时间。 。 。
I've been wanting to try out the Accordion effect on mootools but I can't get it to work, it's just like the js doesn't load at all
this is the HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>BarDiJan - We Deliver</title>
<link rel="stylesheet" href="/stylesheets/reset.css" type="text/css" />
<link rel="stylesheet" href="/stylesheets/style.css" type="text/css" />
<script type="text/javascript" src="/javascripts/mootools-core-1.3-accordion.js"></script>
<script type="text/javascript" src="/javascripts/mootools-more.js"></script>
<script type="text/javascript" src="/javascripts/application.js"></script>
</head>
<body>
<div class="container">
<div id="accordion">
<h3 class="toggler">What we Do</h3>
<div class="element">
<p>We are people who deliver professional quality identity to you, we have wide range of support.
</p>
</div>
<h3 class="toggler">What we Did</h3>
<div class="element">
<p>Under Construction</p>
</div>
<h3 class="toggler">What we Offer</h3>
<div class="">
<ul>
<li>Web Design</li>
<li>Identity</li>
</ul>
</div>
</div>
</div>
</body>
</html>
This is the application.js code
windows.addEvent('domready', function() {
var accordion = new Accordion($('h3.toggler'),$('div.element'), {
display: 2,
opacity: false,
alwaysHide: true,
onActive: function(toggler) { toggler.setStyle('color', '#929292'); },
onBackground: function(toggler) { toggler.setStyle('color', '#000000'); }
});
});
Is there anything that I did wrong? Also I use sinatra if that matters.
Also thanks for your time. . .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您忘记将
element
类添加到最后一个元素。这是一个有效的jsfiddle: http://jsfiddle.net/arian/YqNuh/
You forgot to add the
element
class to the last element.This is a working jsfiddle: http://jsfiddle.net/arian/YqNuh/
你犯了一个错误,窗口,不是窗口;-)
所以 :
you make a mistake, window, not windows ;-)
so :