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 7497985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:17:40+00:00 2026-05-29T19:17:40+00:00

jQuery 1.7.1, jQuery UI tabs. I have the following HTML representing tabs, <div id=tabs>

  • 0

jQuery 1.7.1, jQuery UI tabs. I have the following HTML representing tabs,

<div id="tabs">
    <ul>
        <li><a href="t1" title="content">Gallery</a></li>
        <li><a href="t2" title="content">Polls</a></li>
        <li><a href="t3" title="content">Events</a></li>
    </ul>
<div id="content"></div>
</div>

I need to show an indicator in the ‘content’ div container when I click or select the tab. I tried the following,

HTML

<div id="content"><img id="ind" src="images/indicator.gif" 
alt="Loading..." style="display:none"/></div>

JavaScript

$.ajaxSetup({
cache:false,
beforeSend: function() {
   $('#ind').show()
},
complete: function(){
   $('#ind').hide()
},
success: function() {}
}); 

This is working with the following tab select code, which I execute to select a default tab when the page loads,

var $tabs = $('#tabs').tabs();
$tabs.tabs('select', 1);

But whenever i click on the tab, indicator is not displaying. Any idea why?

  • 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-05-29T19:17:41+00:00Added an answer on May 29, 2026 at 7:17 pm

    You haven’t call any ajax in tab selection.

    if you are calling tab content by ajax that indicator will display.

    I have test this with small example, added below.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Load Demo</title>
    <link rel="stylesheet" href="demos.css">
    <link rel="stylesheet" href="jquery.ui.tabs.css">
    
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
    <script type="text/javascript" src="jquery.ui.core.js"></script>
    <script type="text/javascript" src="jquery.ui.widget.js"></script>
    <script type="text/javascript" src="jquery.ui.tabs.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
        $.ajaxSetup({
        cache:false,
        beforeSend: function() {
           $('#ind').show()
        },
        complete: function(){
           $('#ind').hide()
        },
        success: function() {}
        }); 
    
        $( "#tabs" ).tabs({
            ajaxOptions: {
                error: function( xhr, status, index, anchor ) {
                    $( anchor.hash ).html(
                        "Couldn't load this tab. We'll try to fix this as soon as possible. " +
                        "If this wouldn't be a demo." );
                }
            }
        });
    
    });
    </script>
    </head>
    
    <body>
    <div id="content" style="border:1px solid red"><img id="ind" src="images/indicator.gif" alt="Loading..." style="display:none"/></div>
    <div id="tabs">
        <ul>
            <li><a href="#tabs-1">Preloaded</a></li>
            <li><a href="load.php?url=http://www.google.com">Tab 1</a></li>
            <li><a href="load.php?url=http://www.yahoo.com">Tab 2</a></li>
            <li><a href="load.php?url=http://www.msn.com">Tab 3 (slow)</a></li>
            <li><a href="ajax/content4-broken.php">Tab 4 (broken)</a></li>
        </ul>
        <div id="tabs-1">
            <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
        </div>
    </div>
    
    </body>
    </html>
    

    New Code with extra JQuery Plugin

    <!DOCTYPE html>
    <html lang="en">
    <!--
    
      Created using /
      Source can be edited via /iwajir/8/edit
    
    -->
    <head>
    <link class="jsbin" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
    <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
    <script class="jsbin" src="http://malsup.github.com/jquery.blockUI.js"></script>
    
        <meta charset="utf-8">
        <title>jQuery UI Tabs - Content via Ajax</title>
        <script>
        $.ajaxSetup({
            cache:false,
            beforeSend: function() {
                 $('#content').block({ 
                  message: '<img id="ind" src="images/indicator.gif" alt="Loading..." style="border: 1px solid red"/>', 
                    css: { 
                            width: '100%', 
                            width: '100%', 
                            padding: '5px', 
                            backgroundColor: '#FFF', 
                            '-webkit-border-radius': '10px', 
                            '-moz-border-radius': '10px', 
                            color: '#000' 
                      } 
                }); 
            },
            complete: function(){
    
            },
                success: function() {}
            }); 
    
        $(function() {
            $( "#tabs" ).tabs({
                ajaxOptions: {
                    success:function()
                    {
                        $('#content').unblock(); 
                    },
                    error: function( xhr, status, index, anchor ) {
                        $( anchor.hash ).html(
                            "Couldn't load this tab. We'll try to fix this as soon as possible. " + "If this wouldn't be a demo." );
                    }
                }
            });
    
    
    
        });
        </script>
    </head>
    <body>
    <div id="tabs" style="position:relative">
        <ul>
            <li><a href="http://jsbin.com/ewoyos/2" title="content">Tab 1</a></li>
            <li><a href="http://jsbin.com/imakug/3" title="content">Tab 2</a></li>
            <li><a href="http://jsbin.com/ayocul" title="content">Tab 3</a></li>
        </ul>
        <div id="content" style="border: 1px solid red"></div>
    </div>
    
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following tabs in jquery-tools: <!-- tabs --> <ul class=css-tabs> <li><a href=/example/a>ABC</a></li>
I have a (parent) window containing JQuery tabs: <div id=tabs> <ul class=tabHeader> <li><a href=?ctrl=doSomething
I have the following code to generate Jquery UI tabs: <div id=tabs-loading-message style=display:none>Loading, Please
I am using jquery UI tabs I have three ajax tabs like so: <div
I have a fairly complex html form enhanced via jquery. It has multiple tabs,
I have the following html code: <ul> <li id=a1>content</li> <li id=a2>content</li> <li id=a3>content</li> <li
I have the following JQuery Code concerning my tabs : $(#onglet>ul>li).click(function(){ $(#onglet ul li).removeClass('Selectionne').addClass(OngletPrincipal);
I have the following jQuery script on my site to switch tabs without reloading
I have the following tabs on certain div on my page: (this code is
I have the following html code <!DOCTYPE html> <html lang=en> <head> <meta name=viewport content=width=device-width;

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.