Valerie Sharp
Valerie Sharp

Reputation: 49

I can't get my jQuery to work and I'm not sure what I'm doing wrong

so I'm really new at all of this stuff and I'm a little stuck. I've been working on this project but for some reason I can't get my jQuery to load no matter what I do.

here's my HTML

<head>
<meta charset="utf-8">
<title>Eerbivore</title>
    <link rel="stylesheet" href="gal.css">
<script src="jquery-2.1.3.min.js"></script>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="gal.js"></script>

jQuery

$('#gallery').flickity({
    cellAlign: 'center',
    wrapAround: true
});

I'm using Brackets as my editor. Any help or anything thing I should add would be very helpful.

Upvotes: 0

Views: 91

Answers (2)

Jasper
Jasper

Reputation: 821

as the others mentioned, only include one library of jquery, also worth mentioning that .flickity() is not native in jquery and the code for that should be included aswell.

Upvotes: 0

Norlihazmey Ghazali
Norlihazmey Ghazali

Reputation: 9060

I think the problem is here, you included more than one of jquery core library.

//<--- remove any of this
<script src="jquery-2.1.3.min.js"></script> 
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>

And for this code, it is better if you put inside document.ready.(Ignore if already done this part)

<script>
$(function(){
   $('#gallery').flickity({
     cellAlign: 'center',
     wrapAround: true
   });
});
</script>

Upvotes: 2

Related Questions