CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   Javascript/JQuery conflict? (http://www.codingforums.com/showthread.php?t=272799)

thoroprod 09-11-2012 12:44 AM

Javascript/JQuery conflict?
 
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

Code:

        <!-- 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

AndrewGSW 09-11-2012 12:53 AM

I assume this:

Code:

$().UItoTop({ easingType: 'easeOutQuart' });
should be

Code:

$('#someelement').UItoTop({ easingType: 'easeOutQuart' });
// or..
$.UItoTop(defaults);
// or
$('#someelement').UItoTop(defaults);

You are also loading the jQuery library twice - it should only be loaded once.

thoroprod 09-11-2012 01:15 AM

Quote:

Originally Posted by AndrewGSW (Post 1268800)
I assume this:

Code:

$().UItoTop({ easingType: 'easeOutQuart' });
should be

Code:

$('#someelement').UItoTop({ easingType: 'easeOutQuart' });
// or..
$.UItoTop(defaults);
// or
$('#someelement').UItoTop(defaults);

You are also loading the jQuery library twice - it should only be loaded once.


it didnt make any difference. thanks though.

VIPStephan 09-11-2012 09:11 AM

Quote:

Originally Posted by AndrewGSW (Post 1268800)
You are also loading the jQuery library twice - it should only be loaded once.

Not just twice, three times and in three different versions!
thoroprod, please read my thoughtfully written post about this issue. You’re probably the ten millionth person to ask about this.

thoroprod 09-11-2012 10:27 PM

Quote:

Originally Posted by VIPStephan (Post 1268885)
Not just twice, three times and in three different versions!
thoroprod, please read my thoughtfully written post about this issue. You’re probably the ten millionth person to ask about this.

ahh thanks i removed one of the jquery that was referenced twice and everything is working fine now.


All times are GMT +1. The time now is 08:36 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.