gpt4 book ai didi

jquery - javascript 和 jquery 新手。我没有正确关闭某些东西吗? Dreamweaver 只说 "Syntax Error"

转载 作者:行者123 更新时间:2023-12-01 06:22:56 25 4
gpt4 key购买 nike

<script>
$(document).ready(function () {
// Code to bring each link on to screen and in position
$("#link1").animate({
left: '30px',
top: '5px'
}, 1000);
$("#link2").animate({
left: '80px',
top: '5px'
}, 1400);
$("#link3").animate({
left: '130px',
top: '5px'
}, 1400);
$("#link4").animate({
left: '180px',
top: '5px'
}, 1600);
$("#link5").animate({
left: '230px',
top: '5px'
}, 1800);

// Fade in & out on hover
$("#link1").hover(function () {
$(this).fadeOut(150);
$(this).fadeIn(150);
});

// Fade in & out on hover
$("#link2").hover(function () {
$(this).fadeOut(150);
$(this).fadeIn(150);
});

// Fade in & out on hover
$("#link3").hover(function () {
$(this).fadeOut(150);
$(this).fadeIn(150);
});

// Fade in & out on hover
$("#link4").hover(function () {
$(this).fadeOut(150);
$(this).fadeIn(150);
});

// Fade in & out on hover
$("#link5").hover(function () {
$(this).fadeOut(150);
$(this).fadeIn(150);
});

// Nudge the link when "clicked"
$("#link1").mousedown(function () {
$(this).css("padding-top", "5px");
});

$("#link1").mouseup(function () {
$(this).css("padding-top", "0px");
});

// Nudge the link when "clicked"
$("#link2").mousedown(function () {
$(this).css("padding-top", "5px");
});

$("#link2").mouseup(function () {
$(this).css("padding-top", "0px");
});

// Nudge the link when "clicked"
$("#link3").mousedown(function () {
$(this).css("padding-top", "5px");
});

$("#link3").mouseup(function () {
$(this).css("padding-top", "0px");
});

// Nudge the link when "clicked"
$("#link4").mousedown(function () {
$(this).css("padding-top", "5px");
});

$("#link4").mouseup(function () {
$(this).css("padding-top", "0px");
});

// Nudge the link when "clicked"
$("#link5").mousedown(function () {
$(this).css("padding-top", "5px");
});

$("#link5").mouseup(function () {
$(this).css("padding-top", "0px");
});



// Parallax Scroll
$(window).bind('scroll', function (e) {
parallaxScroll();
});

function parallaxScroll() {
var scrolledY = $(window).scrollTop();
$('#bblogo1').css('top', '-' + ((scrolledY * 0.6)) + 'px');
$('#bblogo2').css('top', '-' + ((scrolledY * 0.5)) + 'px');
$('#bblogo3').css('top', '-' + ((scrolledY * 0.3)) + 'px');
$('#bblogo4').css('top', '-' + ((scrolledY * 0.9)) + 'px');
$('#bblogo5').css('top', '-' + ((scrolledY * 0.6)) + 'px');
$('#bblogo6').css('top', '-' + ((scrolledY * 0.1)) + 'px');
$('#bblogo7').css('top', '-' + ((scrolledY * 0.4)) + 'px');

$('#bbspinner').animate(function (){
$(this).css
("background","url(images/bblogorender0000.png)");
});

});
</script>

最佳答案

将您的代码替换为您缺少右括号的代码

       $(document).ready(function () 
// Code to bring each link on to screen and in position
{ $("#link1").animate({
left: '30px',
top: '5px'
}, 1000);
$("#link2").animate({
left: '80px',
top: '5px'
}, 1400);
$("#link3").animate({
left: '130px',
top: '5px'
}, 1400);
$("#link4").animate({
left: '180px',
top: '5px'
}, 1600);
$("#link5").animate({
left: '230px',
top: '5px'
}, 1800);

// Fade in & out on hover
$("#link1").hover(function () {
$(this).fadeOut(150);
$(this).fadeIn(150);
});

// Fade in & out on hover
$("#link2").hover(function () {
$(this).fadeOut(150);
$(this).fadeIn(150);
});

// Fade in & out on hover
$("#link3").hover(function () {
$(this).fadeOut(150);
$(this).fadeIn(150);
});

// Fade in & out on hover
$("#link4").hover(function () {
$(this).fadeOut(150);
$(this).fadeIn(150);
});

// Fade in & out on hover
$("#link5").hover(function () {
$(this).fadeOut(150);
$(this).fadeIn(150);
});

// Nudge the link when "clicked"
$("#link1").mousedown(function () {
$(this).css("padding-top", "5px");
});

$("#link1").mouseup(function () {
$(this).css("padding-top", "0px");
});

// Nudge the link when "clicked"
$("#link2").mousedown(function () {
$(this).css("padding-top", "5px");
});

$("#link2").mouseup(function () {
$(this).css("padding-top", "0px");
});

// Nudge the link when "clicked"
$("#link3").mousedown(function () {
$(this).css("padding-top", "5px");
});

$("#link3").mouseup(function () {
$(this).css("padding-top", "0px");
});

// Nudge the link when "clicked"
$("#link4").mousedown(function () {
$(this).css("padding-top", "5px");
});

$("#link4").mouseup(function () {
$(this).css("padding-top", "0px");
});

// Nudge the link when "clicked"
$("#link5").mousedown(function () {
$(this).css("padding-top", "5px");
});

$("#link5").mouseup(function () {
$(this).css("padding-top", "0px");
});



// Parallax Scroll
$(window).bind('scroll', function (e) {
parallaxScroll();
});

function parallaxScroll() {
var scrolledY = $(window).scrollTop();
$('#bblogo1').css('top', '-' + ((scrolledY * 0.6)) + 'px');
$('#bblogo2').css('top', '-' + ((scrolledY * 0.5)) + 'px');
$('#bblogo3').css('top', '-' + ((scrolledY * 0.3)) + 'px');
$('#bblogo4').css('top', '-' + ((scrolledY * 0.9)) + 'px');
$('#bblogo5').css('top', '-' + ((scrolledY * 0.6)) + 'px');
$('#bblogo6').css('top', '-' + ((scrolledY * 0.1)) + 'px');
$('#bblogo7').css('top', '-' + ((scrolledY * 0.4)) + 'px');

$('#bbspinner').animate(function (){
$(this).css
("background","url(images/bblogorender0000.png)");
});
}
});

您可以在此处检查 Javascript 验证 http://jsfiddle.net/

关于jquery - javascript 和 jquery 新手。我没有正确关闭某些东西吗? Dreamweaver 只说 "Syntax Error",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16372262/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com