I need to hide/show
div's with jquery in Joomla 2.5. I included the *.js
files in default.php
template with:
<?php
JHTML::script('jquery-1.11.0.min.js', 'templates/mytemplate/js/');
JHTML::script('bbbx.js', 'templates/mytemplate/js/');
?>
I have a simple div in my default.php template:
<div class="myclass" id="myid">
<h1>Hallo</h1>
</div>
And my bbbx.js
file looks like this:
$(document).ready(function() {
alert("Your alert.");
$("div.myclass").hide();
});
The bbbx.js
file is found, alert is showing, but hide()
doesn't work. The same code works perfectly well without Joomla. Please help, what is the problem here?
alert(jQuery === $)
, also check whether the element is present usingalert($("div.myclass").length)
– Arun P Johny$
is colliding with another library and you would have to usenoConflict
method. – web-nomadalert(jQuery === $)
shows 'false' andalert($("div.myclass").length)
is not coming up at all... – vogele