遗失:属性ID之后 [英] missing : after property ID

查看:75
本文介绍了遗失:属性ID之后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白我在这里做错了什么...第3行报失了:财产ID后

I don't understand what I'm doing wrong here... line 3 is reporting missing : after property ID

$(document).ready(function() {

    $('#imagegallery img').each(function({$(this).css({ width: '100%'});});

    $('#imagegallery').cycle({
        timeout: 0,
        fx: 'scrollHorz',
        width: '100%',
        height: 'auto',
        next: '.next',
        prev: '.prev' 
    });



    $("#imagegallery").touchwipe({
        wipeLeft: function() {
            $("#imagegallery").cycle("next");
        },
        wipeRight: function() {
            $("#imagegallery").cycle("prev");
        }
    });
});


推荐答案

问题在于这一行:

$('#imagegallery img').each(function({$(this).css({ width: '100%'});});

应为:

    // missing ) --------------------v
$('#imagegallery img').each(function(){$(this).css({ width: '100%'});});

虽然你可以像这样缩短它:

Although you can shorten it like this:

$('#imagegallery img').css({ width: '100%'});

这篇关于遗失:属性ID之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆