为什么我的jQuery不能在IE上运行(在Safari、Chrome和FF中运行良好)?
他,在那里,我已经尝试了大约几个小时没有任何线索(我使用的是Wordpress),很难知道jQuery有什么问题。Windows/Mac中的FF和Chrome很好用 我在标题中使用:为什么我的jQuery不能在IE上运行(在Safari、Chrome和FF中运行良好)?,jquery,windows,wordpress,internet-explorer,Jquery,Windows,Wordpress,Internet Explorer,他,在那里,我已经尝试了大约几个小时没有任何线索(我使用的是Wordpress),很难知道jQuery有什么问题。Windows/Mac中的FF和Chrome很好用 我在标题中使用: <!DOCTYPE html> 这是我进行测试的网站: 这是我的JS代码: jQuery(document).ready(function() { //Menu jQuery("ul.menu").superfish({ delay : 1
<!DOCTYPE html>
这是我进行测试的网站:
这是我的JS代码:
jQuery(document).ready(function() {
//Menu
jQuery("ul.menu").superfish({
delay : 100,
animation : {opacity:'show',height:'show'},
//speed : 10,
autoArrows : true,
dropShadows : false
});
//Popup FancyBox
jQuery('.fancybox-media').fancybox({
maxWidth : 800,
maxHeight : 600,
fitToView : false,
width : '70%',
height : '70%',
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none'
});
jQuery('.fancybox').fancybox();
var thumbnails = 'a:has(img)[hrefjQuery=".jpg"]';
jQuery(thumbnails).addClass("fancybox").attr("rel","fancybox");
jQuery(".popup").fancybox({
'width' : '75%',
'height' : '75%',
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe'
});
//Expand
jQuery('div.moexpander').hide();
jQuery('a.moexpander').click(function(){
jQuery(this).parent().next('div.moexpander').slideToggle();
return false;
});
//Slideshow Destacados, Create an array of titles
var titles = jQuery('#cycle div.item').find("h3").map(function() { return jQuery(this).text(); });
//Add an unordered list to contain the navigation
//Invoke the cycle plugin on #cycle
jQuery('#cycle').before('<ul id="pager" class="sprites bannerBg"></ul>').cycle({
//Specify options
fx :'fade', //Name of transition effect
speed : 600,
delay : -1200,
pause : 1,
pager : '#pager', //Selector for element to use as pager container
pagerAnchorBuilder: function (index) { //Build the pager
return '<li><a href="#">' + titles[index] + '</a></li>';
},
updateActivePagerLink: function(pager, currSlideIndex) {
jQuery(pager).find('li').removeClass('active').filter('li:eq('+currSlideIndex+')').addClass('active');
}
});
jQuery('#cycle').hover(function() {
jQuery('.pause').show();
}, function() {
jQuery('.pause').hide();
});
//Slideshow Voluntariado
jQuery('#cyclePopular').after('<div id="navPopular">')
.cycle({
fx : 'scrollHorz',
speed : 'fast',
delay : -1200,
pause : 1,
pager : '#navPopular'
});
//Slideshow Avisos
jQuery('#cycleAvisos').cycle({
fx : 'scrollHorz',
delay : -4000,
pause : 1,
prev: '#prev',
next: '#next',
pager : '#navAvisos',
after: onAfter
});
//Make Avisos's Height auto-resizing
function onAfter(curr, next, opts, fwd) {
var jQueryht = jQuery(this).height();
//set the container's height to that of the current slide
jQuery(this).parent().animate({height: jQueryht});
}
//Make all the block clickable
jQuery("#link").click(function(){
window.location=jQuery(this).find("a").attr("href");
return false;
});
//Add CSS to Sidebar Pages
jQuery('#sidebar-pages').find("li").before("<span class='sprites bulletR left'></span>");
// Tabs
jQuery.fn.easytabs = function(){
//Default Action
jQuery(this).find(".easytabs_content").hide(); //Hide all content
jQuery(this).find("ul.easytabs li:first").addClass("active").show(); //Activate first tab
jQuery(this).find(".easytabs_content:first").show(); //Show first tab content
jQuery(this).find(".easytabs_content li a").before("<span class='sprites bulletR'></span>"); //Show bullets
//On Click Event
jQuery("ul.easytabs li").click(function() {
jQuery(this).parent().parent().find("ul.easytabs li").removeClass("active"); //Remove any "active" class
jQuery(this).addClass("active"); //Add "active" class to selected tab
jQuery(this).parent().parent().find(".easytabs_content").hide(); //Hide all tab content
var activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
jQuery(activeTab).fadeIn(); //Fade in the active content
return false;
});
};//end function
jQuery("div[class^='easytabs']").easytabs(); //Run function on any div with class name of "easytabs"
// Search animation with IE statements
var input = jQuery('input#s');
var divInput = jQuery('div.input');
var width = divInput.width();
var outerWidth = divInput.parent().width() - (divInput.outerWidth() - width) - 28;
var submit = jQuery('#searchSubmit');
var txt = input.val();
input.bind('focus', function() {
if(input.val() === txt) {
input.val('');
}
jQuery(this).animate({color: '#000'}, 300); // text color
jQuery(this).parent().animate({
width: outerWidth + 'px',
backgroundColor: '#fff', // background color
paddingRight: '43px'
}, 300, function() {
if(!(input.val() === '' || input.val() === txt)) {
if(!(jQuery.browser.msie && jQuery.browser.version < 9)) {
submit.fadeIn(300);
} else {
submit.css({display: 'block'});
}
}
}).addClass('focus');
}).bind('blur', function() {
jQuery(this).animate({color: '#b4bdc4'}, 300); // text color
jQuery(this).parent().animate({
width: width + 'px',
backgroundColor: '#e8edf1', // background color
paddingRight: '15px'
}, 300, function() {
if(input.val() === '') {
input.val(txt)
}
}).removeClass('focus');
if(!(jQuery.browser.msie && jQuery.browser.version < 9)) {
submit.fadeOut(100);
} else {
submit.css({display: 'none'});
}
}).keyup(function() {
if(input.val() === '') {
if(!(jQuery.browser.msie && jQuery.browser.version < 9)) {
submit.fadeOut(300);
} else {
submit.css({display: 'none'});
}
} else {
if(!(jQuery.browser.msie && jQuery.browser.version < 9)) {
submit.fadeIn(300);
} else {
submit.css({display: 'block'});
}
}
});
});
jQuery(文档).ready(函数(){
//菜单
jQuery(“ul.menu”).superfish({
延误:100,
动画:{不透明度:'show',高度:'show'},
//速度:10,,
自动箭头:对,
dropShadows:错误
});
//弹出式FancyBox
jQuery('.fancybox media').fancybox({
最大宽度:800,
最大高度:600,
菲托维:错,
宽度:“70%”,
身高:70%,
自动调整大小:false,
closeClick:false,
openEffect:'无',
近距离效应:“无”
});
jQuery('.fancybox').fancybox();
var缩略图='a:has(img)[hrefjQuery=“.jpg”]”;
jQuery(缩略图).addClass(“fancybox”).attr(“rel”,“fancybox”);
jQuery(“.popup”).fancybox({
“宽度”:“75%”,
“高度”:75%,
“自动缩放”:false,
“transitionIn”:“无”,
“transitionOut”:“无”,
“type”:“iframe”
});
//扩展
jQuery('div.moexpander').hide();
jQuery('a.moexpander')。单击(函数(){
jQuery(this).parent().next('div.moexpander').slideToggle();
返回false;
});
//幻灯片演示Destacados,创建标题数组
var titles=jQuery('#cycle div.item').find(“h3”).map(函数(){return jQuery(this.text();});
//添加无序列表以包含导航
//在#cycle上调用cycle插件
jQuery('#cycle')。在('
')之前。循环({
//指定选项
fx:'fade',//过渡效果的名称
速度:600,,
延迟:-1200,
暂停:1,
寻呼机:'#pager',//用作寻呼机容器的元素的选择器
pagerAnchorBuilder:函数(索引){//生成寻呼机
返回“”;
},
updateActivePagerLink:函数(寻呼机、currSlideIndex){
jQuery(pager).find('li').removeClass('active').filter('li:eq('+currSlideIndex+')).addClass('active');
}
});
jQuery(“#cycle”).hover(函数(){
jQuery('.pause').show();
},函数(){
jQuery('.pause').hide();
});
//幻灯片自愿
jQuery('#cyclePopular')。在('')之后
.循环({
fx:‘滚动人’,
速度:“快”,
延迟:-1200,
暂停:1,
寻呼机:“#navPopular”
});
//幻灯片
jQuery('#cycleAvisos')。cycle({
fx:‘滚动人’,
延迟:-4000,
暂停:1,
上一页:“#上一页”,
下一个:“#下一个”,
传呼机:“#纳瓦维索斯”,
之后
});
//使Avisos的高度自动调整大小
函数onAfter(curr、next、opts、fwd){
var jQueryht=jQuery(this.height();
//将容器的高度设置为当前幻灯片的高度
jQuery(this.parent().animate({height:jQueryht});
}
//使所有块都可单击
jQuery(“#链接”)。单击(函数(){
window.location=jQuery(this.find(“a”).attr(“href”);
返回false;
});
//将CSS添加到侧边栏页面
jQuery(“#侧边栏页”)。在(“”)之前查找(“li”);
//标签
jQuery.fn.easytabs=函数(){
//默认动作
jQuery(this.find(“.easytabs_content”).hide();//隐藏所有内容
jQuery(this).find(“ul.easytabs li:first”).addClass(“active”).show();//激活第一个选项卡
jQuery(this).find(“.easytabs_content:first”).show();//显示第一个选项卡内容
jQuery(this).find(“.easytabs\u content li a”)。在(“”)之前;//显示项目符号
//点击事件
jQuery(“ul.easytabs li”)。单击(函数(){
jQuery(this).parent().parent().find(“ul.easytabs li”).removeClass(“active”);//删除任何“active”类
jQuery(this).addClass(“active”);//将“active”类添加到所选选项卡
jQuery(this).parent().parent().find(“.easytabs_content”).hide();//隐藏所有选项卡内容
var activeTab=jQuery(this).find(“a”).attr(“href”);//查找rel属性值以标识活动选项卡+内容
jQuery(activeTab).fadeIn();//淡入活动内容
返回false;
});
};//结束函数
jQuery(“div[class^='easytabs']”).easytabs();//在类名为“easytabs”的任何div上运行函数
//用IE语句搜索动画
var input=jQuery('input#s');
var=jQuery('div.input');
var width=divInput.width();
var outerWidth=divInput.parent().width()-(divInput.outerWidth()-width)-28;
var submit=jQuery('#searchSubmit');
var txt=input.val();
input.bind('focus',function(){
if(input.val()==txt){
input.val(“”);
}
jQuery(this).animate({color:'#000'},300);//文本颜色
jQuery(this).parent().animate({
宽度:外径+px,
背景色:'#fff',//背景色
paddingRight:'43px'
},300,函数(){
如果(!(input.val()==''| input.val()==txt)){
if(!(jQuery.browser.msie&&jQuery.browser.version<9)){
提交.法代因(300);
}否则{
css({display:'block'});
}
}
}).addClass(“焦点”);
}).bind('blur',function(){
jQuery(this).animate({color:'#b4bdc4'},300);//文本颜色
jQuery(this).parent().animate({
宽度:宽度+px,
背景色:'#e8edf1',//背景色
paddingRight:'15px'
},300,函数(){
if(input.val()==''){
input.val(txt)
}
}).removeClass(“焦点”);
if(!(jQuery.browser.msie&&jQuery.browser.version<9)){
提交
jQuery('div.moexpander').hide();
function someFunct() {
.....
}
function someFunct() {
.....
};