473,378 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

JQuery problem in a Joomla template

106 100+
hello ,
i'm facing a problem in executing a very simple fading effect on an image in jquery , the code works fine but when placed in the index file for a joomla template , nothing at all happens !!the code is not working , i googled and found that i may have to use jQuery.noConflict(); function but also that did not work for me ..pls help i'm stuck
Jun 6 '12 #1

✓ answered by omerbutt

which version of joomla are you using joomla versions higher than 1.5 by default include the support for mootools thats why you are having problems running jquery as you have to CALL THE JQUERY BEFORE THE MOOTOOLS LIBRARY IS LOADED AND THEN CALL THE JQUERY.NOCONFLICT() and then load the mootools library if you are designing the component or module for joomla then you may have to use he righ method of loading the libraries from with in the module / component to let joomla arrange the loading of the motools and the jquery library , it would have been better if you provided the index page link where you are calling the jquery so that i may point out to you why this is happening and would be easier for you to know the logic behind this error.
here is an example how i used to manage these conflicts
may be it would help you out

Expand|Select|Wrap|Line Numbers
  1.  
  2. $uri = JFactory::getURI();
  3.  
  4.     $filename_js="js/jquery.js";
  5.     $filename_js_2="js/moo-tip.js";
  6.     $filename_js_3="js/reservations.js";
  7.     $filename_js_4="js/MooDialog.js";
  8.     $filename_js_5="js/MooDialog.Alert.js";
  9.     $filename_js_6="js/MooDialog.Confirm.js";
  10.     $filename_js_7="media/system/js/mootools-more.js";
  11.     $filename_css="css/styles.css";    
  12.     $filename_css_2="css/MooDialog.css";
  13.  
  14.         JHTML::Script($filename_js_7,true);
  15.     JHTML::Script($filename_js_4,$path_component);
  16.     JHTML::Script($filename_js_5,$path_component);
  17.     JHTML::Script($filename_js_6,$path_component);
  18.     $document->addScript($path_component.$filename_js_2);
  19.     $document->addScript($path_component.$filename_js);
  20.     $document->addScript($path_component.$filename_js_3);
  21.       $document->addStyleSheet($path_component.$filename_css);
  22.     $document->addStyleSheet($path_component.$filename_css_2);
  23.       $document->addScriptDeclaration($this->customScripts());
  24.  
  25.  
regards,
Omer Aslam

5 2798
omerbutt
638 512MB
can you provide the code or link to the url where you are working , normally when you use the jQuery.noConflict() it means you are using another library along jquery and when you do it , you have to replace the $ from jquery code with jQuery
, for example
Expand|Select|Wrap|Line Numbers
  1. $('#my_id').val() 
will be changed to
Expand|Select|Wrap|Line Numbers
  1. jQuery.("#my_id").val();
Jun 7 '12 #2
jessy
106 100+
i was testing a small script from W3schools
Expand|Select|Wrap|Line Numbers
  1. $(document).ready(function(){
  2.              $('button').click(function(){
  3.              $('p').toggle();
  4.               });
i did not include the source for the jquery library since i found it in the original source code for the joomla template im working on but i also tried including it once again above the following code and also nothing happens
Jun 7 '12 #3
omerbutt
638 512MB
which version of joomla are you using joomla versions higher than 1.5 by default include the support for mootools thats why you are having problems running jquery as you have to CALL THE JQUERY BEFORE THE MOOTOOLS LIBRARY IS LOADED AND THEN CALL THE JQUERY.NOCONFLICT() and then load the mootools library if you are designing the component or module for joomla then you may have to use he righ method of loading the libraries from with in the module / component to let joomla arrange the loading of the motools and the jquery library , it would have been better if you provided the index page link where you are calling the jquery so that i may point out to you why this is happening and would be easier for you to know the logic behind this error.
here is an example how i used to manage these conflicts
may be it would help you out

Expand|Select|Wrap|Line Numbers
  1.  
  2. $uri = JFactory::getURI();
  3.  
  4.     $filename_js="js/jquery.js";
  5.     $filename_js_2="js/moo-tip.js";
  6.     $filename_js_3="js/reservations.js";
  7.     $filename_js_4="js/MooDialog.js";
  8.     $filename_js_5="js/MooDialog.Alert.js";
  9.     $filename_js_6="js/MooDialog.Confirm.js";
  10.     $filename_js_7="media/system/js/mootools-more.js";
  11.     $filename_css="css/styles.css";    
  12.     $filename_css_2="css/MooDialog.css";
  13.  
  14.         JHTML::Script($filename_js_7,true);
  15.     JHTML::Script($filename_js_4,$path_component);
  16.     JHTML::Script($filename_js_5,$path_component);
  17.     JHTML::Script($filename_js_6,$path_component);
  18.     $document->addScript($path_component.$filename_js_2);
  19.     $document->addScript($path_component.$filename_js);
  20.     $document->addScript($path_component.$filename_js_3);
  21.       $document->addStyleSheet($path_component.$filename_css);
  22.     $document->addStyleSheet($path_component.$filename_css_2);
  23.       $document->addScriptDeclaration($this->customScripts());
  24.  
  25.  
regards,
Omer Aslam
Jun 7 '12 #4
jessy
106 100+
Wow, this helped alot !
problem solved
Thanks a million :)
Jun 7 '12 #5
omerbutt
638 512MB
my pleasure :) , please choose the right answer so that it may help others who come here searching for the same issue ,
regards,
Omer Aslam
Jun 14 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: KCC | last post by:
I apologize if this is not the correct group to ask this question but I can't find another newgroup that might help and I am having no luck at the Mambo or Joomla forums. I am looking for a...
14
by: Osiris | last post by:
time for a Joomla newsgroup ! support the initiative on news.groups and nl.newsgroups. search there with keyword "joomla" and give your opinion, with solid arguments.
7
by: Dawson | last post by:
A client of ours with a large ecommerce shop is looking at moving to Joomla... The question is: Is Joomla ready for large critical enterprise e-commerce application(s), with white-labelling...
18
by: Shelly | last post by:
Opinions sought: ============ A prospective client wants customizations to Joomla using PHP. I have not done anything with Joomla. Is it worth my while to invest the time to set it up and learn...
7
by: Shalini Bhalla | last post by:
hi i am using joomla and i have installed RocketTheme Hyperion in my site . But the peoblem is that following code is not showing image in IE where as It is working fine in Mozilla... #searchmod...
1
by: sbettadpur | last post by:
hello, I installed joomla 1.5 on windows xp, and i created my own template and i installed successfully in joomla 1.5. My question is I want to change the menu link for example if i click in...
8
by: Annalyzer | last post by:
I agreed to write an event registration site for a group and then later found out that their website was created with Joomla. I had never heard of Joomla so I started reading about it and it seems...
0
tharden3
by: tharden3 | last post by:
Hey Bytes Community, I have requested help on the Joomla! forums, but I know some Bytes members that are familiar with Joomla!. I am building a website using a siteground template (link) for...
0
by: Stuart Hunter | last post by:
Hello, I am currently developing a Joomla site with a YOOtheme template 'Neo' and I'm finding the menu a little too 'quick to appear' on MOUSEOVER and I would really like a delay of around 0.5-1...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.