[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.4

jQuery Animated Tabs script has js error due to race condition with other js

Asked by somnamblst in JavaScript

I have a very stimple jQuery Image Rollover script that does not use $(document).ready(function(){

Works great except when it is placed on a page that has another script, most of the time I get a staus bar error of jQuery undefined in IE, never in FF. The error does not effect functionality.

I tried adding $(document).ready(function(){ but it breaks the function and throws this error in Firebug

tab_change is not defined
onclick(click clientX=0, clientY=0)

Here is the tute I started with
http://peps.ca/blog/animated-javascript-tabs-in-1-line-of-code/

The author has several jQuery entries on his blog, I am starting to wonder if there is a reason why he didn't begin with $(document).ready(function(){ in this example.

Here is my nonworking demo that errors with $(document).ready(function(){ added

http://xsotek.com/demo10/testTabs.html

Or is some sort of timer a better solution?



      
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
<!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>Tabbed Test</title>
    
 
 
   <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
    <style type="text/css">	
	.wrapp {
		position: relative;
		width: 300px;
		margin: 10px;
		text-align: left;
		
	}
	.boxx {
		display: block;
		width: 300px;
		height: 228px;
		border: 1px solid #282B79;
		background-color: #ffffff;
		background-repeat: no-repeat;
	}
	.details {
		position:absolute;
		top:2px;
		margin: 0;
		left:120px;
		width: 180px;
		padding: 4px 1px 4px 1px;
		line-height: 12px;
		color: #ffffff;
	}
	
 
	
	.tabber {
		width: 100%;
		display: block;
		position: absolute;
		margin: 0;
		padding: 0;
		list-style: none;
		float: left;
		font-size: 12px;
		font-family: Arial,Helvetica,sans-serif;
		text-align: center;
		line-height: 10px;
		color: #990000;
		word-spacing: 0.1em;
		font-weight: bold;
	}
	.tabber .tabs{
		display: block;
		position: absolute;
		top: -29px;
		margin: 0;
		padding: 0;
		width: 100%;
		list-style: none;
		float: left;
	}
	.tabber .tabs li a {
		background-color: #f4f4f4;
		padding: 4px;
		border: 1px solid #e1e1e1;
		border-bottom: none;
		float: left;
	}
	.tabber .tabs li {
		float: left;
	}
	.tabber .tabbox {
		float: left;
		width: 100%;
		cursor: hand;
	}
	
	.hide {
		display: none;
	}
	.show {
		display: block;
	}
</style>
 
 <script type="text/javascript" charset="utf-8">
  jQuery.noConflict();
 jQuery(document).ready(function(){
	function tab_change( parent, elm ) {
 		 jQuery('#'+parent+' .show')
			.slideUp('fast', function() {
				 jQuery('#'+elm).slideDown('normal').addClass('show');
			})
			.removeClass('show')
			.addClass('hide');
	}
});
  
 </script>
 
</head>
<body>
 
 <div class="wrapp">
 <div class="tabber">
  
  <ul class="tabs">
   <li>&nbsp; <a  onclick="tab_change('images', 'first')" class="roll">one</a></li>
 
   <li>&nbsp;<a  onclick="tab_change('images', 'second')" class="roll">two</a></li>
   <li>&nbsp;<a  onclick="tab_change('images', 'third')" class="roll">three</a></li>
 
   
  </ul>
<div class="boxx">
  <div class="tabbox" id="images">
   
   <div id="first" class="show">
<img src="one.jpg" width="300" height="228" alt="" border="0">
    <div class="details"><strong>one</strong><br />
 
</div>
   </div>
   
   <div id="second" class="hide">
<img src="two.jpg" width="300" height="228" alt="" border="0">
        <div class="details"><strong>two</strong>
 
</div>
   </div>
   
   <div id="third" class="hide">
<img src="three.jpg" width="300" height="228" alt="" border="0">
        <div class="details"><strong>three</strong><br />
 
</div>
   </div>
   
   </div>
  </div>
  
   </div>
   
  </div>
 
 
</body>
</html>
[+][-]05/23/08 09:21 AM, ID: 21633503Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: JavaScript
Sign Up Now!
Solution Provided By: hielo
Participating Experts: 1
Solution Grade: A
 
[+][-]05/22/08 09:30 PM, ID: 21629432Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/23/08 07:07 AM, ID: 21632236Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/23/08 07:48 AM, ID: 21632597Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/23/08 08:27 AM, ID: 21633015Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/23/08 08:39 AM, ID: 21633119Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/23/08 09:11 AM, ID: 21633417Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/23/08 11:15 AM, ID: 21634395Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 / EE_QW_2_20070628