Inserting jQuery code into HTML

I have a pretty simple question. I'm trying to insert this infinite carousel jQuery script into my HTML file: http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-infinite-carousel-plugin/

I can't seem to figure out how to get it in there though. No matter what I've tried, the script yields no result. Can anyone help? I've never used jQuery before. Here is my code (it has a master page):

<%@ Page Title="" Language="C#" MasterPageFile="~/advisor.master" %>

<script runat="server">

</script>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="js/infinitecarousel/jquery.infinitecarousel3.js"></script>      
<script type="text/javascript">
    $(function () {
        $('#carousel').infiniteCarousel();
    });

</script>   

    <style>        
    </style>


    <div id="carousel"></div>
    <ul>
    <li><img alt="" class="auto-style1" src="image1.jpg" /></li>
    <li><img alt="" class="auto-style1" src="image2.jpg" /></li>
    <li><img alt="" class="auto-style1" src="image3.jpg" /></li>
   </ul>

</asp:Content>

Answers


The only error I can see in your code is that you initialize the carousel on an empty div <div id="carousel"></div>.

Try this instead:

<!--<div id="carousel"></div> -->
<ul id="carousel">
    <li><img alt="" class="auto-style1" src="image1.jpg" /></li>
    <li><img alt="" class="auto-style1" src="image2.jpg" /></li>
    <li><img alt="" class="auto-style1" src="image3.jpg" /></li>
</ul>

Apart from that, if you implemented the plugin and jQuery correctly, and it looks like you did, and placed the files of the plugin where they're supposed to be, I can't see any reason why it shouldn't work.


Need Your Help

Git: Proper way of merging changes to an earlier commit (manually rewind and replay?)

git git-merge

I'm not sure what the correct way of addressing this scenario is in git, whatever I do I get weird results.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.