September 10, 201214 yr I'm trying to add a 'back to top button' and it looks like the javascript/jquery is conflicting with my image slider. when i add the script towards the end of the body tag, either the image slider or the back to top will not work correctly. if i place the back to top script before the slider script, the back to top plugin does not appear at all. if i place the back to top script after the image slider script, the back to top appears and works fine but the image slider does not load the images. this is the script i added <!-- Back To Top jquery --> <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script> <!-- UItoTop plugin --> <script src="js/jquery.ui.totop.js" type="text/javascript"></script> <!-- Starting the plugin --> <script type="text/javascript"> $(document).ready(function() { /* var defaults = { containerID: 'toTop', // fading element id containerHoverID: 'toTopHover', // fading element hover id scrollSpeed: 1200, easingType: 'linear' }; */ $().UItoTop({ easingType: 'easeOutQuart' }); }); </script> url: http://thoroprod.com Edited September 10, 201214 yr by thoroprod
September 11, 201214 yr you only need to load the jQuery library once and at a quick look at your page I saw three. Add the one above and that's four. They will conflict, especially if they are different releases.
September 11, 201214 yr I'm trying to add a 'back to top button' and it looks like the javascript/jquery is conflicting with my image slider. when i add the script towards the end of the body tag, either the image slider or the back to top will not work correctly. if i place the back to top script before the slider script, the back to top plugin does not appear at all. if i place the back to top script after the image slider script, the back to top appears and works fine but the image slider does not load the images. this is the script i added <!-- Back To Top jquery --> <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script> <!-- UItoTop plugin --> <script src="js/jquery.ui.totop.js" type="text/javascript"></script> <!-- Starting the plugin --> <script type="text/javascript"> $(document).ready(function() { /* var defaults = { containerID: 'toTop', // fading element id containerHoverID: 'toTopHover', // fading element hover id scrollSpeed: 1200, easingType: 'linear' }; */ $().UItoTop({ easingType: 'easeOutQuart' }); }); </script> url: http://thoroprod.com Hi Thoroprod, It could be that the different instances of Jquery are conflicting. Before your function, try creating a no conflict variable like: var $ui = $.noConflict(); Then when you call the UI Top plugin, call it using your new variable. Like this: var $ui = $.noConflict(); $(document).ready(function() { $ui().UItoTop({ easingType: 'easeOutQuart' }); }); Lyndsey.
September 11, 201214 yr Hi Thoroprod, It could be that the different instances of Jquery are conflicting. Before your function, try creating a no conflict variable like: var $ui = $.noConflict(); Then when you call the UI Top plugin, call it using your new variable. Like this: var $ui = $.noConflict(); $(document).ready(function() { $ui().UItoTop({ easingType: 'easeOutQuart' }); }); Lyndsey. I think you can safely change your Experience to at least 'Intermediate'. :|
September 11, 201214 yr Author thanks for the responses everyone i got it to work by removing one of the references to jquery as there was a duplicate!
Create an account or sign in to comment