Cycle plugin displays code/string
Hi,
I am new to JQuery, so I am sure I am simply doing something wrong. I managed to set up a slide show with JQuery Cycle. But additional to the picture this code snippet is diplayed on screen:
-
$('#show1').cycle('fade');
Thats the HTML I used:
-
<div id="show1" class="pics">
<img src="pics/beach1.jpg" width="200" height="200" />
<img src="pics/beach2.jpg" width="200" height="200" />
<img src="pics/beach3.jpg" width="200" height="200" />
</div>
<pre><code class="mix">$('#show1').cycle('fade');</code></pre>
I got this code from Cycle plugin website, but in the description the class="mix" is not described. I guess it has to do with the Chili pack hightlithing of code.
Anyways, when removing the class="mix", the string is still displayed. Of course I could use css display set to none for this snippet, but I am not sure if it is the right way.
Thats the code in the head section:
-
<script type="text/javascript" src="scripts/jquery-1.2.6.js"></script>
<script type="text/javascript" src="scripts/jquery.cycle.all.js"></script>
<script type="text/javascript">
$.fn.cycle.defaults.speed = 900;
$.fn.cycle.defaults.timeout = 6000;
$(document).ready(function() {
$('pre code').each(function() {
eval($(this).text());
});
})
I really would be happy if someone could give me a hint, what is going wrong. Okay, I know, I am going wrong
But probably someone knows how I can fix this problem.
Thanks,
Jan