09 October 2013
If Fancybox library does not work, this might be due to the conflicts with other JS libraries and not the syntax error.
In 99% of cases this works like a charm, but sometimes it just does not. I myself encountered the following problems in my experience:
- Syntax errors. Mostly happen when I occasionally miss or mistype the class or ID on hyperlink (the one that is specified when firing the plugin).
- The error "MSIE underfined". This one is widely covered on the Internet and is basically a bug in the script. The easiest fix is to upgrade your Fancybox to the latest version (2.1.5 at the time of writing).
- Conflicts with other libraries. That is the most difficult part really. Usually you never suspect this can happen and spend hours and hours trying to figure out what is missed or mis-typed.
If you've already spent more than 10-15 minutes and it still does not work (worse - does not even show any errors in the debugger console), this means it is potentially a conflict with other scripts.
I am aware of at least two potential conflicts:
- With Twitter Bootstrap library (the one which is widely used to make a responsive design). This issue has been addressed in some places already.
- With JQuery Validate library - I had to switch this library off (mainly because I didn't use it anyway).
So the general advice would be to temporarily comment out all scripts except for Fancybox and JQuery and once that minimal configuration works (it should really!), uncomment other scripts one by one, hence identifying the root of the problem.
Post a comment