Need Help with onClick opening Dialog box
Hi Guys,
Very new to this and am stuck already with an onClick command and it's puzzling me.
What's meant to happen:
User clicks on the Shopping Cart text (within a div element which has been styled) and it opens a dialog box containing the users cart contents.
Here's the code below...
I think I've done a tad to much this week as I'm probably missing something really easy and am just being stupid.
Any help would be much appreciated.
- <script type="text/javascript">
- $(function() {
- $( 'div.dialog' ).dialog( {modal:true,autoOpen:false} );
- $('CartLink').on( 'click', function() {
- var index = $(this).index() + 1;
- $( '#dialog' + index ).dialog( 'open' );
- });
- });</script>
- <div class="dialog" id="dialog1">Shopping Cart Contents</div>
- <div id="CartLink" class="fluid ShoppingCart"><img src="images/Site/Shopping_cart.gif" alt="" width="25" height="23"/>Shopping Cart</div>