Javascript 无法单击HTML标题菜单下拉列表
嗯。我有一个我用HTML设计的标题-但是每次我尝试将鼠标悬停在产品上,然后单击任何子菜单-我都无法(它们在可单击之前消失) 这方面的一个活生生的例子可以在 有什么建议吗 Custom.jsJavascript 无法单击HTML标题菜单下拉列表,javascript,html,css,Javascript,Html,Css,嗯。我有一个我用HTML设计的标题-但是每次我尝试将鼠标悬停在产品上,然后单击任何子菜单-我都无法(它们在可单击之前消失) 这方面的一个活生生的例子可以在 有什么建议吗 Custom.js $(文档).ready(函数(){ //初始化插件 $([rel^='prettypoto'])。prettypoto({主题:'light_square'});//在不同风格之间选择/dark_rounded/light_rounded/dark_square/light_square/facebook/
$(文档).ready(函数(){
//初始化插件
$([rel^='prettypoto'])。prettypoto({主题:'light_square'});//在不同风格之间选择/dark_rounded/light_rounded/dark_square/light_square/facebook/
//初始化TWITTER提要插件
$('.twitter提要').tweet({
用户名:“ABrighterWorld”,//只需输入您的twitter用户名
加入文本:“自动”,
头像大小:空,
计数:2,//显示的推文数
自动加入文本默认值:“”,
加载文本:“加载最新推文…”//加载推文时显示的文本
});
//FLICKR插件
$(“#flickr图像”).append(“
”);
$('#flickr images ul').jflickrfeed({
限额:10,
Q字符串:{
id:'myflickrID',//输入flickrid,即。67956216@N02
tags:'tags here'//显示带有选定标记的图像(可选)
},
itemTemplate:“”
},函数(数据){
$(#flickr images li a')。prettypto({主题:'light#u square});
});
//文本框激活
$('.textbox,#message,#comment').focus(函数(){
$(this.css({borderColor:'#bbb'});
$(this).blur(函数(){
$(this.css({borderTopColor:'#d1d1d1',borderLeftColor:'#d1d1d1',borderBottomColor:'#e1e1e1e1',borderRightColor:'#e1e1e1e1e1');
});
});
//选项卡导航
$('ul.tab nav').tabs('.tabs>.tab panels>div',{effect:'fade'});
//组合悬停效应-叠加
$('.gallery overlay a img')。悬停(函数(){
$(this.stop().animate({
不透明度:'.1'
}, 300);
},函数(){
$(this.stop().animate({
不透明度:“1”
}, 500);
});
//组合过滤器
$('ul#filter a')。单击(函数(){
$(this.css('outline','none');
$('ul#filter.activefilter')。removeClass('active-filter');
$(this.parent().addClass('active-filter');
var filterVal=$(this.attr('href').toLowerCase().replace('''-');
if(filterVal=='all'){
$('ul.gallery-thumbs li.hidden').fadeIn('slow').removeClass('hidden');
}否则{
$('ul.gallery-thumbs li')。每个(函数(){
if(!$(this).hasClass(filterVal)){
$(this).fadeOut('normal').addClass('hidden');
}否则{
$(this.fadeIn('slow').removeClass('hidden');
}
});
}
返回false;
});
//切换面板
$('.toggle content').hide();//隐藏切换的内容,如果禁用javascript,则内容可见
$('.toggle header a')。单击(函数(){
如果($(this).is('.tog close')){
$(this.removeClass('tog-close'))
.addClass(“tog-open”)
.closest(“.toggle标头”)
.next(“.toggle content”)
.滑动切换(300);
返回false;
}
否则{
$(this.removeClass('tog-open'))
.addClass('tog-close')
.closest(“.toggle标头”)
.next(“.toggle content”)
.滑动切换(300);
返回false;
}
});
//工具提示
$('.social links li[title]')。工具提示({
效果:“褪色”,
fadeInSpeed:300,
衰减速度:200,
不透明度:0.9,
偏移量:[-5,0]
});
//社会联系
$(函数(){
$('.social links li')。动画({
不透明度:'.4'//将所有社交链接图像的不透明度设置为50%
});
$('.social links li')。悬停(函数(){
$(this.stop().animate({
不透明度:“1”//悬停时将所有社交链接图像的不透明度设置为100%
});
},函数(){
$(this.stop().animate({
不透明度:'.4'
});
});
});
//滚动顶部
$('.scroll top').hover(函数(){
$(this.stop().animate({
不透明度:“1”
}, 300);
},函数(){
$(this.stop().animate({
不透明度:'.6'
}, 500);
});
$('.scroll top')。单击(函数(){
$('body,html')。设置动画({
滚动顶部:0
}, 800);
返回false;
});
//导航下拉动画
$('#导航ul').css({display:'none'});//Opera修复
$(“ul导航”).superfish({
hoverClass:'dropdown',//应用于悬停列表项的类
pathClass:'OverIdeThistUse',//已应用于列出指向当前页面的项目的类
PathLevel:1,//保持打开状态或使用pathClass还原的子菜单的级别数
delay:1000,//鼠标在不关闭子菜单的情况下保持在子菜单外的延迟(毫秒)
动画:{opacity:'show',height:'show'},//与jQuery的.animate()方法的第一个参数等效的对象
速度:“fast”,//动画的速度。相当于jQuery的.animate()方法的第二个参数
autoArrows:false,//如果为true,则自动生成箭头标记=以牺牲初始化性能为代价的更干净的源代码
dropShadows:错误
});
//IE按钮悬停修复
$(函数(){
变量按钮=$('.button');
如果($.browser.msie){
$(按钮).css({backgroundPosition:“-20px 35px”})
$(document).ready(function() {
//INITIALIZES PRETTYPHOTO PLUGIN
$("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_square'}); //choose between different styles / dark_rounded / light_rounded / dark_square / light_square / facebook /
//INITIALIZES TWITTER FEED PLUGIN
$('.twitter-feed').tweet({
username: 'ABrighterWorld', //just enter your twitter username
join_text: 'auto',
avatar_size: null,
count: 2, //number of tweets showing
auto_join_text_default: '',
loading_text: 'loading latest tweets...' //text displayed while loading tweets
});
// FLICKR PLUGIN
$('#flickr-images').append('<ul></ul>');
$('#flickr-images ul').jflickrfeed({
limit: 10,
qstrings: {
id: 'myflickrID', // enter Flickr ID i.e. 67956216@N02
tags: 'tags-here' // Displays images with selected tags (optional)
},
itemTemplate: '<li><a href="{{image_b}}" rel="prettyPhoto" ><img src="{{image_s}}" alt="{{title}}" /></a></li>'
}, function(data) {
$('#flickr-images li a').prettyPhoto({theme:'light_square'});
});
// TEXTBOX ACTIVE
$('.textbox, #message, #comment').focus(function (){
$(this).css({borderColor : '#bbb'});
$(this).blur(function (){
$(this).css({borderTopColor : '#d1d1d1', borderLeftColor : '#d1d1d1', borderBottomColor : '#e1e1e1', borderRightColor : '#e1e1e1'});
});
});
//TAB NAVIGATION
$('ul.tab-nav').tabs('.tabs > .tab-panels > div', {effect: 'fade'});
// PORTFOLIO HOVER EFFECT - OVERLAY
$('.gallery-overlay a img').hover(function() {
$(this).stop().animate({
opacity : '.1'
}, 300);
}, function() {
$(this).stop().animate({
opacity : '1'
}, 500);
});
// PORTFOLIO FILTER
$('ul#filter a').click(function() {
$(this).css('outline','none');
$('ul#filter .active-filter').removeClass('active-filter');
$(this).parent().addClass('active-filter');
var filterVal = $(this).attr('href').toLowerCase().replace(' ','-');
if(filterVal == 'all') {
$('ul.gallery-thumbs li.hidden').fadeIn('slow').removeClass('hidden');
} else {
$('ul.gallery-thumbs li').each(function() {
if(!$(this).hasClass(filterVal)) {
$(this).fadeOut('normal').addClass('hidden');
} else {
$(this).fadeIn('slow').removeClass('hidden');
}
});
}
return false;
});
//TOGGLE PANELS
$('.toggle-content').hide(); //hides the toggled content, if the javascript is disabled the content is visible
$('.toggle-header a').click(function () {
if ($(this).is('.tog-close')) {
$(this).removeClass('tog-close')
.addClass('tog-open')
.closest('.toggle-header')
.next('.toggle-content')
.slideToggle(300);
return false;
}
else {
$(this).removeClass('tog-open')
.addClass('tog-close')
.closest('.toggle-header')
.next('.toggle-content')
.slideToggle(300);
return false;
}
});
// TOOLTIPS
$('.social-links li[title]').tooltip({
effect: 'fade',
fadeInSpeed: 300,
fadeOutSpeed: 200,
opacity: 0.9,
offset: [-5, 0]
});
// SOCIAL LINKS
$(function() {
$('.social-links li').animate({
opacity : '.4' // sets the opacity to 50% to all social link images
});
$('.social-links li').hover(function() {
$(this).stop().animate({
opacity: '1' // on hover sets the opacity to 100% to all social link images
});
}, function() {
$(this).stop().animate({
opacity : '.4'
});
});
});
// SCROLL TOP
$('.scroll-top').hover(function() {
$(this).stop().animate({
opacity : '1'
}, 300);
}, function() {
$(this).stop().animate({
opacity : '.6'
}, 500);
});
$('.scroll-top').click(function () {
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
//NAVIGATION DROPDOWN ANIMATION
$('#navigation ul').css({display: 'none'}); // Opera Fix
$("ul#navigation").superfish({
hoverClass: 'dropdown', // the class applied to hovered list items
pathClass: 'overideThisToUse', // the class you have applied to list items that lead to the current page
pathLevels: 1, // the number of levels of submenus that remain open or are restored using pathClass
delay: 1000, // the delay in milliseconds that the mouse can remain outside a submenu without it closing
animation: {opacity:'show',height:'show'}, // an object equivalent to first parameter of jQuery’s .animate() method
speed: 'fast', // speed of the animation. Equivalent to second parameter of jQuery’s .animate() method
autoArrows: false, // if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance
dropShadows: false
});
// IE Button hover fix
$(function (){
var button = $('.button');
if ($.browser.msie) {
$(button).css( {backgroundPosition: "-20px 35px"} ).hover(function() {
$(this).stop()
.animate({
backgroundPositionX: "-20px",
backgroundPositionY: "94px"
},300);
},
function() {
$(this).stop().animate({
backgroundPositionX: "-20px",
backgroundPositionY: "35px"
},300).css({backgroundPosition: "-20px 35px"});
});
}
});
}); //END of jQuery
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Brighter World Lighting - NY</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!--imports the main css file-->
<link rel="stylesheet" type="text/css" media="screen" href="css/style.css" />
<!--imports prettyPhoto css file-->
<link rel="stylesheet" type="text/css" media="screen" href="css/prettyPhoto.css" />
<!--imports jquery-->
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<!--imports twitter feed plugin-->
<script type="text/javascript" src="js/jquery.tweet.js"></script>
<!--imports easing plugin-->
<script type="text/javascript" src="js/easing.js"></script>
<!--imports prettyPhoto plugin-->
<script type="text/javascript" src="js/jquery.prettyPhoto.js"></script>
<!--imports jQuery Tools plugin-->
<script type="text/javascript" src="js/jquery.tools.min.js"></script>
<!--imports jQuery superfish plugin-->
<script type="text/javascript" src="js/superfish.js"></script>
<!--imports jQuery jflickrfeed plugin-->
<script type="text/javascript" src="js/jflickrfeed.min.js"></script>
<!--imports jQuery AsyncSlider plugin-->
<script type="text/javascript" src="js/jquery.asyncslider.min.js"></script>
<!--imports custom javascript code-->
<script type="text/javascript" src="js/custom.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
// Setup Slider
$("#async-slider").asyncSlider({
keyboardNavigate: true,
easing: 'easeInOutExpo',
minTime: 600,
maxTime: 1500,
autoswitch: 4800,
centerPrevNextNav: false,
slidesNav: false
});
});
</script>
<!--[if IE 7]><link href="css/ie7.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<!--[if IE 8]><link href="css/ie8.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
</head>
<body>
<div id="header" class="pattern-1">
<div id="header-inner">
<div id="logo">
<img src="img/logo.png" alt="image description" />
<div id="title">
<h1><a href="index.asp"></a></h1>
<p></p>
</div><!-- end title -->
</div><!-- end logo -->
<ul id="navigation">
<li>
<a class="active-nav" href="index.asp">Home</a>
</li>
<li>
<a href="partnership.html">
Energy Partnership Program
</a>
</li>
<li>
<a href="http://bwl.ereverseauction.com">
Energy Auction
</a>
</li>
<li>
<a href="#">Affiliates</a>
</li>
<li id="menu-item-23" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-ancestor current_page_ancestor menu-item-23">
<a href="products.html">Products</a>
<ul class="sub-menu">
<li id="menu-item-31" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-ancestor current-menu-parent current_page_parent current_page_ancestor menu-item-31">
<a href="indoor.html">Indoor Lighting</a>
</li>
<li id="menu-item-34" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-34">
<a href="outdoor.html">Outdoor Lighting</a>
<ul class="sub-menu">
<li id="menu-item-68" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-68"><a href="http://brighterworldlightingllc.com/excelsior-series/">Street Lighting</a></li>
</ul>
</li>
<li id="menu-item-30" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-30"><a href="http://brighterworldlightingllc.com/outdoor-lighting/">OEM/ODM Support</a></li>
</ul>
</li>
<li>
<a href="about.asp">About Us</a>
</li>
<li>
<a href="contact.html">Contact Us</a>
</li>
</ul><!-- end navigation -->
$("ul#navigation").superfish({
// the class applied to hovered list items
hoverClass: 'dropdown',
// the class you have applied to list items that
// lead to the current page
pathClass: 'overideThisToUse',
// the number of levels of submenus that remain
// open or are restored using pathClass
pathLevels: 1,
// the delay in milliseconds that the mouse can
// remain outside a submenu without it closing
delay: 300,
// an object equivalent to first parameter of
// jQuery's .animate() method
animation: { opacity: 'show', height: 'show' },
// speed of the animation. Equivalent to second
// parameter of jQuery's .animate() method
speed: 'fast',
// if true, arrow mark-up generated
// automatically = cleaner source code at expense of initialisation
// performance
autoArrows: false,
dropShadows: false
});