Using Jquery within a post
-
Hi folks, sorry if this is in the wrong section but it seemed to be the place to put it.
Im currently trying to use a jquery crossfade called cycle and I have also used another simple jquery crossfade however, with both pieces of code, instead of crossfading the images it fades out to black then the next image fades in. I have been trying to eliminate possibilties and I dont think that it is the jquery.
I have used both the crossfaders on static html and they worked fine. I cant see anything wrong in my css either so I was wondering if it could be a conflict with the way wordpress works. Has anyone else come across something like this?
here is the code in the head of my template:
<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js”></script>
<script src=”/wp-content/themes/IOL/js/jquery.cycle.all.js”></script><script>
$(document).ready(function() {
$(‘.anim’).cycle({
fx: ‘fade’,
});
});
</script>and this is the code in the actual post:
<div class=”anim”>
<img style=”” src=”/wp-content/uploads/2012/11/Homepage-sidebar-001.jpg” alt=”” width=”960px” />
<img style=”” src=”/wp-content/uploads/2012/11/Homepage-sidebar-002.jpg” alt=”” width=”960px” />
</div>If anyone can offer any help it would be greatly appreciated
P.S Interestingly, when it reaches the end of the images it crossfades perfectly back to the begining!
The topic ‘Using Jquery within a post’ is closed to new replies.