Keyword

K2 Comment Counter Not Working With jQuery Library

More
10 years 9 months ago #122531 by Roman
Hello everone. I am having a problem with K2 item category comment counter. I noticed that it's not clickable when jQuery Library is set to load in the K2 configuration.

When I right click on it and open it in the new window, it opens up just fine. I need the library to load, so I am stuck. Does any one know how to solve this problem? Thank you in advance.

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

  • Francisco Carvalho
  • Francisco Carvalho's Avatar
  • Offline
  • Junior Member
More
10 years 9 months ago #122532 by Francisco Carvalho
Replied by Francisco Carvalho on topic Re: K2 Comment Counter Not Working With jQuery Library
This is probalby a jQuery conflict.

Did you opened your FireBug to get errors?

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

More
10 years 9 months ago #122533 by Roman

Francisco Carvalho wrote: This is probalby a jQuery conflict.

Did you opened your FireBug to get errors?


Hi Francisco. Thank you for taking time to respond. I did check fire bug and I did get the following error:

TypeError: $K2(...).offset(...) is undefined
scrollTop: $K2(target).offset().top

The entire code looks like this:
// Smooth Scroll
$K2('.k2Anchor').click(function(event){
event.preventDefault();
var target = this.hash;
$K2('html, body').stop().animate({
scrollTop: $K2(target).offset().top
}, 500);
});

So I am not sure what the problem is. I know that my modal popup that displays on page load on every page uses jQuery as well as VirtueMart uses the library. Any ideas? I know that I am loading the library only once and only when I disable it, the comment counter works fine.

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

More
10 years 9 months ago #122534 by Roman
Just to add, I am getting that error as soon as I click on comments counter. Thanks.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #122535 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 Comment Counter Not Working With jQuery Library
If you disable it and this code works it means that another version is being loaded as well.

Make sure that only one version is being loaded and it is loaded above other scripts.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
10 years 9 months ago #122536 by Roman
Hi Krikor. Happy New Year. Thanks for responding. How do I make sure that it's loading it above other scripts? As I said, I am using K2, VirtueMart & a modal popup. All 3 use the library. Thank you.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #122537 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: K2 Comment Counter Not Working With jQuery Library
Try using the jQuery Easy plugin. It will force load only on version of jQuery.

Alternatively all these extensions have settings in their params to disable/enable jQuery loading.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
10 years 9 months ago #122538 by Roman
Krikor, I tried that extension, but with no luck. I was still getting this error. I end up commenting it out and I accomplished what I wanted. The comment counter is clickable from "latest items" page. I don't have it enabled in the items itself. So since I commented the code out, I won't have the sliding effect which I don't need to. Thanks.

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


Powered by Kunena Forum