无法使dropotron脚本正常工作[HTML/CSS/JavaScript] [英] Can't get dropotron script to work properly [HTML/CSS/JavaScript]
问题描述
我问了一个先前的问题,关于在我的网页上创建一个类似于模板的下拉菜单.我发现模板是使用dropotron来创建此菜单的.我下载了dropotron,并尝试按照其提供的说明进行操作.
I asked a previous question about creating a dropdown menu on my webpage similar to a template. I figured out that the template was using dropotron to create this menu. I downloaded dropotron and attempted to follow the instructions it provided.
Here's my website, and here's the example that shows a working dropotron script.
以下是指向HTML,CSS和JavaScript的codepen链接:codepen.io/anon/pen/EPaYNz
Here's a codepen link to the HTML, CSS, and JavaScript: codepen.io/anon/pen/EPaYNz
奇怪的是,它可以在Codepen结果中工作,但是我不确定为什么它在我的网站上有问题.我完全复制了HTML,CSS和JavaScript文件.
What's odd is that it works in codepen result, but I'm not sure why it's buggy on my site. I copied the HTML, CSS, and JavaScript files exactly.
有什么想法吗?
谢谢!
编辑:我在代码笔结果中发现的另一个错误是,当我将鼠标悬停在子菜单中的传记"上时,我是谁"消失了.还有解决这个问题的方法吗?
another misc bug I found on the codepen result was when I hover over "Biography" in the submenu, "Who I Am" disappears. Any way to fix this, too?
推荐答案
出于格式化目的,我将其作为答案.您的脚本应该在底部看起来像这样,并且head
:
For formatting purposes I'm putting this as an answer. Your scripts should look like this at the bottom and there should be no scripts in the head
:
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.poptrox.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/jquery.scrollex.min.js"></script>
<script src="assets/js/skel.min.js"></script>
<script src="assets/js/util.js"></script>
<!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
<script src="assets/js/jquery.dropotron.js"></script>
<script>
$(function() {
// Note: make sure you call dropotron on the top level <ul>
$('#nav > ul').dropotron({
offsetY: -10 // Nudge up submenus by 10px to account for padding
});
});
</script>
<script src="assets/js/main.js"></script>
顺便说一句,您的<--[if lte blah]
到底没有一角的闭合角支架>
By the way, your <--[if lte blah]
didn't have the closing angle bracket >
all the way at the end
这篇关于无法使dropotron脚本正常工作[HTML/CSS/JavaScript]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!