SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member Kojinkai's Avatar
    Join Date
    Jan 2010
    Location
    London
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jQuery browser error

    Hi there,

    I am trying to use a simple jQuery script to rotate through some list items in an unordered list.

    I have managed to get this script to successfully work on a different page on a different site but am returning a browser error when transplanting the code onto the new page. Wordpress is loading jQuery and I have written a function to successfully load the following code into the head section within <script> tags
    Code:
    $(document).ready(function(){
    	$('#testimonials .slide');
    	setInterval(function(){
    		$('#testimonials .slide').filter(':visible').fadeOut(1000,function(){
    			if($(this).next('li.slide').size()){
    				$(this).next().fadeIn(1000);
    			}
    			else{
    				$('#testimonials .slide').eq(0).fadeIn(1000);
    			}
    		});
    	},10000);	
    });
    Firebug returns the error $ is not a function. I'm sure its something basic that I have missed but thought I'd better consult the experts anyhow.

    Any help most appreciated,

    Thanks in advance

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you would need to make sure that that code snippet appears AFTER the jQuery include.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •