Avatar of Panos
PanosFlag for Germany

asked on 

Problem with show - hide loader

Hello experts.
I have a problem showing the carloader in the code below.
The page i'm loading in  the itemsholder div is working but before that i don't get the carloader div shown.
Any help?
<!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>Untitled Document</title>
</head>
<body>
  <ul  class="ui-tabs-nav myitems">
     <li id="li_category2">
      <a href="http://test.com/customer_items/items.cfm?category=2">
       <span>test&nbsp;<span class="recc">(4)</span></span>
      </a>
     </li>
     <li id="li_category13">
      <a href="http://test.com/customer_items/items.cfm?category=13">
       <span>test2&nbsp;<span class="recc">(3)</span></span>
      </a>
     </li>
   </ul>
<div id="carloader" class="carloader" style="display:none;"><center><br><br><br><br><br><img src="http://test.com/img/carloader.gif"></center></div>
   <div id="itemsholder"></div>
   <script type="text/javascript" language="javascript" src="http://test.com/js/jquery-1.6.2.min.js"></script>
   <script type="text/javascript">
 $(function() {
	$("ul.myitems li").click(function(e) {
		e.preventDefault();
        var activeTab = $(this).find("a").attr("href");
		var tabNumber = $("ul.myitems li").index(this) + 1;
		$("#carloader").show();
		$("#itemsholder").load(activeTab);
		$("#carloader").hide();
    });
});
 </script> 
</body>
</html>

Open in new window

jQueryJavaScript

Avatar of undefined
Last Comment
Panos
ASKER CERTIFIED SOLUTION
Avatar of mattjp88
mattjp88
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Panos
Panos
Flag of Germany image

ASKER

Thank you .It is working now.
Avatar of Panos
Panos
Flag of Germany image

ASKER

Thank you.
regards
panos
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo