1260 Posts in 349 Topics by 485 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1557 Views |
-
Fancy Box and site-search form in conflict

22 September 2010 at 8:12am
Hello. I have added fancybox to my site. As soon as i enable site-search, fancybox stops working. I am using ss2.4.1 and fancybox jquery.fancybox-1.3.1
As far as i can tell, it seems that the code for the site-search gets added to the bottom of the page, just before the body tag closes. Shouldnt this code be in the <head> tag of the page.
I am using the "//Enable search form //FulltextSearchable::enable();" command in the _config.php file to activate the site-search.
Any help will be appreciated.
-
Re: Fancy Box and site-search form in conflict

22 September 2010 at 7:28pm
Look at your app for a couple of things which could be causing this.
* A lot of SilverStripe modules and core uses jQuery so to avoid including jQuery twice the best line to use to add jQuery is
<% require javascript(sapphire/thirdparty/jquery/jquery.js) %>
* Make sure your code uses closures to prevent it from conflicting. See the template for it at http://doc.silverstripe.org/javascript#custom_jquery_code.
* Ideally don't include raw script tags in templates for things which rely on other files. Best to make them a file and use <% require javascript(...) %> to add it to the requirements log.
As far as i can tell, it seems that the code for the site-search gets added to the bottom of the page, just before the body tag closes. Shouldnt this code be in the <head> tag of the page.
SS loads all its required files at the bottom of the page for performance reasons. See http://developer.yahoo.com/performance/rules.html for more information on that.
-
Re: Fancy Box and site-search form in conflict

14 October 2010 at 6:02am
Same problem here except I am using jFlow Plus for an image rotator. I have all of my js enclosed and am calling the jQuery file as you mentioned. I don't see errors in Firebug either. Any ideas?
-
Re: Fancy Box and site-search form in conflict

14 October 2010 at 6:06am
Woot woot! Idiot alert here. I had an errant ; in the closure that caused it to stop working. All's good now. Much thanks for the help.
| 1557 Views | ||
|
Page:
1
|
Go to Top |



