News:

Support the VirtueMart project and become a member

Main Menu

TypeError: jQuery(...).fancybox is not a function

Started by H13, January 31, 2013, 00:10:58 AM

Previous topic - Next topic

H13

Hi, in VM 2.0.18a (Joomla! 2.5.8) I get this problem while loading product page

TypeError: jQuery(...).fancybox is not a function
"transitionOut"   :   "elastic"

- it depends on used template, mostly when the template loads jquery, there is such problem (I have tried to disable the loading/not loading jquery etc. in VM settings, but does not help)

Is there any way e.g. how to change the fancybox to standard popup window or other popup?

Thank you.

Jan


jenkinhill

You have a jQuery issue, sounds like you are not loading the js files in the correct order. This is something that I have seen in some commercial templates, and can often be "fixed" by using jQuery Easy

To remove the FB function you can edit the image display code in the  product details display template(s) and set the edited files as template overrides.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

ichepurnoy

#2
Quote from: jenkinhill on January 31, 2013, 10:12:20 AM
You have a jQuery issue, sounds like you are not loading the js files in the correct order. This is something that I have seen in some commercial templates, and can often be "fixed" by using jQuery Easy

To remove the FB function you can edit the image display code in the  product details display template(s) and set the edited files as template overrides.
Dear Jenkinhill!

Thanks for pointing at jQuery Easy, it really helps with JS conflicts.
Though I found a bug in latest Virtuemart 2.6.0, which was also present in versions 2.0.24 - 2.0.26. The Bug is in the setting "Use fancybox" in Configuration \ Templates.  If you select YES, the site loads Fancybox. If "NO",  then site still loads fancybox, and adds facebox. This way , when "Use fancybox = NO", we have:

  • increased chance of a conflict. In my case - it's 100% same conflict, as Topic starter has
  • 2 libraries instead of 1, pollution of code
  • facebox does not work. When jQuery Easy runs, it works , but no title is added to the image

I've made a solution, it fixes all 3 points. It's not a hack! Just a small fix (the IF condition checking for Fancybox state was missing  ;)) . I fixed it using your own pieces of code.
3 edited Files are:
\components\com_virtuemart\assets\js\facebox.js
\components\com_virtuemart\views\productdetails\tmpl\default_images.php
\components\com_virtuemart\assets\css\facebox.css
You can compare them with originals to see the diference.


[attachment cleanup by admin]

Milbo

hahaha

"// WTF is all this?????  Do we really need it?"

It makes the gallery effect on fancybox. That you get arrows to click to the next image. Imho not needed for facebox, yes.

For what you added this?
<span></span>\

in facebox.js? opacity 0.6? I wonder if there should be any opacity. why not 0.0?

Anyway your changes looks good. They are added for vm2.6
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/