开发者

Scriptaculous drop down menu not working in views/show

My knowledge of Ruby on Rails and javascript is rudimentary so please forgive me if this question has a simple answer. I have a website that needs a multi level dropdown menu. I have adapted scriptalculous drop down menu which is working on a test copy of my website using mongrel. There are several pages each with its own layout. When I jump from page to page the drop down menu works fine, but when I go to any "view/show" page only the first level menu works. I suspect that jumping to show loses the javascript somehow. Anybody knows how to solve this problem. In all my layout head I have the following:-

<%= stylesheet_link_tag 'style' %>
<%= javascript_include_tag :defaults %>
<script src="javascripts/prototype.js" type="text/javascript"></script开发者_StackOverflow社区>
<script src="javascripts/scriptaculous.js" type="text/javascript"></script>
<script type='text/javascript' src='javascripts/menu.js'></script>

I am using the protype, controls etc that came with Scriptaculous download.


sounds most likely that your problem lies outside of the short code snippet included in your question.

Have you checked with Firebug to see if the menu is being built and sent appropriately, that all of the needed files are included, etc.? (might not even be a javascript issue)

There are lots of other possibilities but it's rather hard to determine from the code provided.

Given that the other pages in your site have working menus, and presumably the menu is the same across pages (navigation menu, I'd guess), then it is extremely likely that the markup or javascript files are different (unclosed tags, missing tags, inline css with display:none, etc)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜