DevKev
DevKev

Reputation: 6304

My Javascript isn't working in Joomla 3, is something conflicting?

I have very siple javascript working in jsFiddle but for some reason when I add to Joomla 3 CMS it doesn't work. The content stays static and does not move. I am putting the html and js in a HTML Module with no WYSIWYG editor and even tried putting the js in external file and no dice. Any thoughts?

function ticker() {
    $('#jsTicker li:first').slideUp(function() {
        $(this).appendTo($('#jsTicker')).slideDown(1500);
    });
}
setInterval(ticker, 6000);

fiddle: http://jsfiddle.net/KevinOrin/Zh3wU/ site: http://bit.ly/13GerYd

Upvotes: 0

Views: 701

Answers (3)

Vipul
Vipul

Reputation: 325

you can use jQuery no conflict as :

var jat =  $.noConflict();

now replace $ in your code with jat

Upvotes: 1

sabof
sabof

Reputation: 8192

You wrote <script type="javascript"> instead of <script type="application/javascript">

EDIT

You've also forgot an extra }); in the end.

Upvotes: 1

shrunyan
shrunyan

Reputation: 456

Running the provided code in a console on the example page shows it working, so I think you have a document ready issue.

You should run the function in a jQuery document ready statement. http://learn.jquery.com/using-jquery-core/document-ready/

// A $( document ).ready() block.
$( document ).ready(function() {
    console.log( "ready!" );
});

Upvotes: 0

Related Questions