I
I
icui4cuto2018-09-25 14:36:50
JavaScript
icui4cuto, 2018-09-25 14:36:50

Joomla module not working?

Good day!

There was a desire to make a floating module in the Joomla sidebar, I tried different plugin options, etc., nothing works. The jquery library is included.

Now I tried the option without a plugin, found on the net:

css style
.adsense-sidebar {}

The script itself

<script type="text/javascript">
$(function() {
var offset = $("adsense-sidebar").offset();
var topPadding = 7;
$(window).scroll(function() {
if ($(window).scrollTop() > offset.top) {
$("#fixed").stop().animate({marginTop: $(window).scrollTop() - offset.top + topPadding});
}
else {$("#fixed").stop().animate({marginTop: 15});};});
});
</script>

Advertising code When I go to the console, I find $ is not a function, in fact, I also swore at other plugins. And here is the patient himself. For some reason, the link to the site is not displayed. What can I do?
<div class="adsense-sidebar">Код рекламы</div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lamer350, 2018-09-25
@icui4cuto

jQuery no conflict is also loaded in joomla by default, in Google you will find many answers on how to use jquery in this case, the easiest (in explanation) is to replace all $ with jQuery

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question