I am trying to create a simple slider for my website and found this example on jsfiddle: http://jsfiddle.net/AtFeF/79/
From that I created an html file containing all th
It seems that you haven't included jquery file into your html document.
Hence, the code :
$(function () {
setInterval(cycleImages, 1400);
});
wont work. Because $ belongs to jQuery.
So you need to include jquery either by
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
or download jquery file from jquery.com to your local drive and include with relative path as
<script src="js/jquery.min.js"></script>
Import/include jquery file in your code
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
or the version that you have at fiddle 1.9.1
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
Add jQuery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
Enclose the script in onload
, and add it after the jQuery script tag
$(window).load(function(){
// existing code
});
You can generally find what you need to add in left sidebar of jsFiddle
You need to include the required javascript files (particularly jQuery).
Add this section to your <head>
and it should work.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
or
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>