我写了一个jquery代码,它将在悬停时扩展某些元素.我希望代码只在不扩展时才展开.这是我的代码.它似乎没有正常工作.
$(document).ready(function() {
var labelstatus = 0;
});
$(document).ready(function() {
$("a.rm").hover(function () {
if (labelstatus != 1){
$("#expensereduction,#envimpact,#mtextlft,#initaud,#energaud").fadeOut();
var currentFontSize = $('.initiate').css('font-size');
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum*3;
$('.initiate').delay(500).animate({
fontSize: newFontSize
});
return false;
var labelstatus = 1;
}
else {
}
});
});
Run Code Online (Sandbox Code Playgroud) 我试图检索链接的title属性的前两个字符,将其存储到变量中,然后将该变量作为函数调用.在它所说的代码中,"#" + s我希望放置该值.有任何想法吗?
$(".flow").click(function() {
if (labelstatus = 1) {
$('.rmflow a,.weflow a,.scflow a,.coflow a,.wcflow a').css({
color: "#b7b7b7"
});
$("." + this.title + " a").css({
color: "#3e3e3e"
});
$("#" + this.title).parent().animate({
opacity: '1'
});
$('.initiate').animate({
opacity: '.4'
}, 100);
// variable to be put in the below selector
$("#" + s).parent().animate({
opacity: '1'
});
$('.info').fadeOut(200);
$("#" + this.title).fadeIn(1000);
return false;
}
else {
}
});
Run Code Online (Sandbox Code Playgroud)