Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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

  • #2
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    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.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #3
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by AndrewGSW View Post
    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.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,630
    Thanks
    6
    Thanked 1,002 Times in 975 Posts
    Quote Originally Posted by AndrewGSW View Post
    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.

  • Users who have thanked VIPStephan for this post:

    thoroprod (09-11-2012)

  • #5
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •