Are you enjoying the extensions? Did you like the support? Help others decide.

Leave a review

file Problem: "Back-to-top" jquery link does not work

More
11 years 10 months ago #1559 by t_zaharia
Hello!
(I created another post but for some reason I didn' t see it in the forum)

We are using joomla 2.5 and have installed jQueryEasy plugin so as to avoid conflicts. all modules that require jQuery work fine but the "Back to Top" jquery link (which requires jquery as well) does not work...there may be some conflict.

My script is the following:

<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/el_GR/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script type="text/javascript">
$(function() {
$(window).scroll(function() {
if($(this).scrollTop() != 0) {
$('#toTop').fadeIn();
} else {
$('#toTop').fadeOut();
}
});

$('#toTop').click(function() {
$('body,html').animate({scrollTop:0},800);
});
});

$(function() {
$(window).scroll(function() {
if($(this).scrollTop() != 0) {
$('#toTop2').fadeIn();
} else {
$('#toTop2').fadeOut();
}
});

$('#toTop2').click(function() {
$('body,html').animate({scrollTop:0},800);
});
});
</script>

When we place the following line:

<script type="text/javascript" src="code.jquery.com/jquery-latest.js">

"Back-to-top" works fine but the other modules do not..

For some reason, it needs that line in the page, is it not called by the plugin?

Please help!

Thanks.

Please Log in or Create an account to join the conversation.

More
11 years 10 months ago - 11 years 10 months ago #1560 by admin
Hello,
forum posts are moderated before being posted in order to avoid spam.
Your problem comes from the fact you are using the symbol '$' on your web page. In order to avoid conflicts, you need to make this 'safer'. For instance, enclose all your calls into
jQuery(document).ready(function($){ <your code here> });
You will find plenty of information in the developer's corner and specifically at
Conflict Issues

Olivier.
Last edit: 11 years 10 months ago by admin.

Please Log in or Create an account to join the conversation.