Bxslider not working

Permalink
Hello!
I have a problem with bxslider (http://bxslider.com). I'm creating a new template in concrete5. The problem is that the Java script doesn't run (code below). I have copied the generated html code to a new html file and everything is ok. But not in concrete5
Please give me some advise.

<script type="text/javascript">
$(document).ready(function(){
  $('.bxslider').bxSlider();
});
</script>

View Replies: View Best Answer
mnakalay replied on at Permalink Reply
mnakalay
Hello,
This is not enough to help you with the issue. Would you have a live website we could look at?

Did you check the browser's console for possible error messages?
tzmudzinski replied on at Permalink Reply
Hello,
Thank You for replies. Here is the link to the website:http://tomekzmudzinski.com/_cms/...
Maybe the problem is that concrete5 attach jquery at the end of the head tag? I've checked and paste the script just before the </head> and still have the same problem.
WillemAnchor replied on at Permalink Reply
WillemAnchor
is the bxslider .js file loaded properly ?

fromhttp://bxslider.com/faqs:

Nothing is working. What am I doing wrong?

Here is a list of things to check that should solve most "not working" problems:

Is the jQuery library included in the <head> of the document?
The jQuery library needs to be included BEFORE the jquery.bxslider.min.js file.
Is the jquery.bxslider.min.js file linked properly? Usually people will upload the file to a js directory, then link to it like so: <script src="js/jquery.bxslider.min.js"></script>
Using Firebug (http://getfirebug.com/), check the console for any errors. Any Javascript errors can and will prevent the slider from functioning properly.
Are you calling .bxSlider() inside of a $(document).ready() call? For more info on the .ready() call, click here.
tzmudzinski replied on at Permalink Reply
Hello,
Thank You for replies. Here is the link to the website:http://tomekzmudzinski.com/_cms/...
Maybe the problem is that concrete5 attach jquery at the end of the head tag? I've checked and paste the script just before the </head> and still have the same problem.
mnakalay replied on at Permalink Best Answer Reply
mnakalay
Yes you have problems at the jQuery level.

You actually have 2 problems:
1- You are loading a bunch of scripts in your header BEFORE the line that says
Loader::element('header_required');

That line is responsible for loading Concrete5 own scripts including jQuery. It means that any script that needs jQuery and is loaded before jQuery will not work.

2- You are loading your own version of jQuery and then some scripts and then Concrete5 loads its own jQuery superseding yours and stopping your scripts from working.

You need to load your scripts AFTER the line I mentioned above AND NOT load your own jQuery. You can leave all the css before that line though it doesn't matter.
tzmudzinski replied on at Permalink Reply
Thank You very much!
Everything works perfect!