Problem with javascript (jquery) on my template

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Locked
ats2008
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Jan 19, 2011 9:30 am

Problem with javascript (jquery) on my template

Post by ats2008 » Wed Apr 06, 2011 1:54 pm

Hi guys,

please give me some advice, 'cos after few hours struggling with the code, the only I want is to throw the computer (and programing at all) through the window... ;) .

The problem is javascript that doesn't work on my joomla 1.5.22 tamplate.

I am trying to use on it script that slides login modul down according to this tutorial, that on html file works perfectly http://www.webskrypty.pl/2010/wysuwany- ... -w-jquery/.



As the script is made on jquery I use the nonconflict plugin.

I tried to place the code directly in header like so:

Code: Select all

<script type="text/javascript">
$(document).ready(function(){
 $('#login-toggle').click(function() {
  $('#login-content').slideToggle(300, function() {
  $("#login-toggle p").toggle();
  });
 });
});
</script></head>
and link like so:

Code: Select all

<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/js/slider.js">
no reaction.

I tried even to put it into beez and Ja Purity templates in the same ways - no reaction.

I have used jquery plugins quite a few time on my websites and it was ok. Now I have no idea, what is going on.

Thanks for any help.
Last edited by ats2008 on Wed Apr 06, 2011 9:46 pm, edited 1 time in total.

ats2008
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Jan 19, 2011 9:30 am

Re: Problem with javascript (jquery) on my template

Post by ats2008 » Wed Apr 06, 2011 9:45 pm

I've finnally found solution:

I have wrong syntax.

This is correct:
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j('#login-toggle').click(function() {
$j('#login-content').slideToggle(300, function() {
$j("#login-toggle p").toggle();
});
});
});
</script>


Locked

Return to “Templates for Joomla! 1.5”