ScrollPane and ScrollTo plugins conflict
Hi everyone!
This is my first attempt on using JQuery so I'm mostly doing copy/paste/tweak.
I'm using the ScrollTo plugin to create a horizontal sliding content effect.
Here is the code:
- <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
- <script type="text/javascript" src="js/jquery.scrollTo.js"></script>
- <script type="text/javascript" src="jScrollPane.js"></script>
- <script>
- $(document).ready(function() {
- $('a.panel').click(function () {
- $('a.panel').removeClass('selected');
- $(this).addClass('selected');
-
- current = $(this);
-
- $('#wrapper').scrollTo($(this).attr('href'), 800);
-
- return false;
- });
- $(window).resize(function () {
- resizePanel();
- });
-
-
- });
- function resizePanel() {
- width = $(window).width();
- height = $(window).height();
- mask_width = width * $('.item').length;
-
- $('#debug').html(width + ' ' + height + ' ' + mask_width);
-
- $('#wrapper, .item').css({width: width, height: height});
- $('#mask').css({width: mask_width, height: height});
- $('#wrapper').scrollTo($('a.selected').attr('href'), 0);
-
- }
- /* -- here is the second script -- */
- $(function()
- {
- $('#section').jScrollPane();
- });
- </script>
-
- <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
- <script type="text/javascript" src="js/jquery.scrollTo.js"></script>
- <script type="text/javascript" src="jScrollPane.js"></script>
- <script>
- $(document).ready(function() {
- $('a.panel').click(function () {
- $('a.panel').removeClass('selected');
- $(this).addClass('selected');
-
- current = $(this);
-
- $('#wrapper').scrollTo($(this).attr('href'), 800);
-
- return false;
- });
- $(window).resize(function () {
- resizePanel();
- });
-
-
- });
- function resizePanel() {
- width = $(window).width();
- height = $(window).height();
- mask_width = width * $('.item').length;
-
- $('#debug').html(width + ' ' + height + ' ' + mask_width);
-
- $('#wrapper, .item').css({width: width, height: height});
- $('#mask').css({width: mask_width, height: height});
- $('#wrapper').scrollTo($('a.selected').attr('href'), 0);
-
- }
- /* -- here is the second script -- */
- $(function()
- {
- $('#section').jScrollPane();
- });
- </script>
Do you see anything wrong? If I run the jScrollPane on its own, it works fine!
Thank you for your help and time!