Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7842369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:18:12+00:00 2026-06-02T16:18:12+00:00

I added this script <script type=text/javascript> var x = 2; //console.log(‘Not broken’); $(‘.email_image li:gt(0)’).css({opacity:0});

  • 0

I added this script

<script type="text/javascript">
    var x = 2;
//console.log('Not broken');
$('.email_image li:gt(0)').css({opacity:0});

setInterval(function() { // function slideshow() { var m = $('.email_image li').size(); x += 1; console.log('Not broken'); if (x > m) { x = 1; } $(".email_image ul li:visible").animate({ opacity: 0 }); $(".email_image ul li:nth-child(" + (x) + ")").animate({ opacity: 1 }); // } }, 5000); </script>


to the index.php of my template. I want to use the script to create a simple slideshow for some set of images. The loop just runs once and stops. Outside Joomla, it works perfectly but in Joomla, it just runs once and stops. Does Joomla have issues with the setInterval function. What is way around this issue?

Here are the links to the demos in Joomla and out of Joomla respectively
Joomla demo
Outside Joomla demo

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:18:14+00:00Added an answer on June 2, 2026 at 4:18 pm

    Even though jQuery path is correct and included fine but $ returns something other than jQuery (seems like a conflict):

    function $(el){if(!el)return null;if(el.htmlElement)return Garbage.collect(el);if([window,document].contains(el))return el;var type=$type(el);if(type=='string'){el=document.getElementById(el);type=(el)?'element':false;}
    if(type!='element')return null;if(el.htmlElement)return Garbage.collect(el);if(['object','embed'].contains(el.tagName.toLowerCase()))return el;$extend(el,Element.prototype);el.htmlElement=function(){};return Garbage.collect(el);}
    

    Here is the error coming on console:

    Uncaught TypeError: Cannot call method 'css' of null
    

    For jQuery, try replacing each instance of $ with jQuery.

    Or you can $ like this:

    (function($){
       // your code here
    })(jQuery);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I have this piece of jquery code: <script type=text/javascript > $(function() {
I think I got the jQuery imports sorted like this: <script type=text/javascript src=https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js></script> <script
I have an external JS file that I load into my HTML <script type=text/javascript
Alright, to start with let's look at some code: <html> <body> <script type=text/javascript> function
I created a new content type for a wiki page library. I added this
I use this code below to load CSS files. var i, a; for(i=0; (a
<?php include('db_connect.php'); ?><head> <link rel=stylesheet type=text/css href=comment-style.css media=screen /> <script type=text/javascript src=../jquery.tablesorter/jquery-latest.js></script> <script type=text/javascript
<!DOCTYPE html> <html> <head> <meta http-equiv=Content-Type content=text/html; charset=UTF-8 /> <script src=https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js></script> <script type=text/javascript> $(
I just added this to my web.xml on my JBOSS server. But it had
EDIT I added this note to explain why I keep this question here. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.