Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-11-2012, 12:44 AM   PM User | #1
thoroprod
New to the CF scene

 
Join Date: Sep 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
thoroprod is an unknown quantity at this point
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
thoroprod is offline   Reply With Quote
Old 09-11-2012, 12:53 AM   PM User | #2
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
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
AndrewGSW is offline   Reply With Quote
Old 09-11-2012, 01:15 AM   PM User | #3
thoroprod
New to the CF scene

 
Join Date: Sep 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
thoroprod is an unknown quantity at this point
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.
thoroprod is offline   Reply With Quote
Old 09-11-2012, 09:11 AM   PM User | #4
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,584
Thanks: 5
Thanked 864 Times in 841 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
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.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Users who have thanked VIPStephan for this post:
thoroprod (09-11-2012)
Old 09-11-2012, 10:27 PM   PM User | #5
thoroprod
New to the CF scene

 
Join Date: Sep 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
thoroprod is an unknown quantity at this point
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.
thoroprod is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:01 AM.


Advertisement
Log in to turn off these ads.