문제

I've been working on getting Shadowbox to work with this CSS/Jquery map and I am almost there, but for some reason I am not sure why I keep getting errors within my javascript. I know I am missing something, but I'm not sure what and I think I need a fresh set of eyes on it.

Here's my code:

<script type="text/javascript">
$(function ($) {
    $("#map-usa").cssMap({
        size: 960,
        'onClick': function (e) {
            Shadowbox.init({
                players: ["iframe,html"]
            });
        });
    });
</script>

I've been running it through JS lint and I'm not sure where the error is stemming from.

도움이 되었습니까?

해결책

You forgot a the closing brace of the onClick function - the reason why your indentation of the last two }); was not matching:

jQuery(function($) {
    $("#map-usa").cssMap({
        size: 960,
        'onClick': function(e) {
            Shadowbox.init({
                players: ["iframe,html"]
            });
        } // <--
    });
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top