Advertisement

10.07.2008 at 08:52PM PDT, ID: 23796143 | Points: 500
[x]
Attachment Details

scrollLeft issue

Asked by vidhubala in JavaScript

Tags:

i have a functionality of hide and show columns working with prev and next links in almost all the browsers like ie, firefox 2 and 3. but not in some product browsers.
scrollLeft method fails. is there any other way to get this functionality done? pl help.Start Free Trial
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:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"  "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<style type="text/css"> 
#theTable {
  width: 1700px;
}
#theTable td {
  width: 170px;
} 
</style>
<script type="text/javascript">
function scroll(dir) {
	var colNum = document.getElementById("scroller").scrollLeft + dir*170;
    if((colNum>=0) && (colNum <= 1700-680))
      document.getElementById("scroller").scrollLeft = colNum;
    return false;
}
</script>
</head>
<body style="background:url('pageBackground.jpg') no-repeat;background-size: 100%;position:fixed;top:0;left:0;width:100%;height:100%;">
<input type="button" value="scroll to" onclick="document.getElementById('scroller').scrollLeft=170" />
<br/>
<table width="850" cellspacing="0" cellpadding="0">
<tr>
<td width="700" onclick="scroll(-2)" style="cursor:pointer;">
	Prev
</td>
<td width="150" onclick="scroll(1)" style="cursor:pointer;">
	Next
</td>
</tr>
</table>
 
<table width="850" cellspacing="0" cellpadding="0">
<tr>
<td width="170">
	<table width="170" cellspacing="0" cellpadding="2" border="1" bgcolor="blue">
		  <tr>
			<td>1</td>
		  </tr>
		  <tr>
			<td>2</td>
		  </tr>
		  <tr>
			<td>3</td>
		  </tr>
		  <tr>
			<td>4</td>
		  </tr>
		  <tr>
			<td>5</td>
		  </tr>
		  <tr>
			<td>6</td>
		  </tr>		
	</table>	
</td>
<td width="680">
	<div id="scroller" style="width:680px;overflow:hidden">
		<table id="theTable" cellspacing="0" cellpadding="2" border="1">
		  <tr>
			<td>1</td>
			<td>2</td>
			<td>3</td>
			<td>4</td>
			<td>5</td>
			<td>6</td>
			<td>7</td>
			<td>8</td>
			<td>9</td>
			<td>10</td>
		  </tr>
		  <tr>
			<td>2</td>
			<td>fsdfsd</td>
			<td>sfdsf</td>
			<td>ffsf</td>
			<td>fsfsd</td>
			<td>11</td>
			<td>12</td>
			<td>13</td>
			<td>14</td>
			<td>15</td>
		  </tr>
		  <tr>
			<td>3</td>
			<td>fsdfsd</td>
			<td>sfdsf</td>
			<td>ffsf</td>
			<td>fsfsd</td>
			<td>21</td>
			<td>22</td>
			<td>23</td>
			<td>24</td>
			<td>25</td>
		  </tr>
		  <tr>
			<td>4</td>
			<td>fsdfsd</td>
			<td>sfdsf</td>
			<td>ffsf</td>
			<td>fsfsd</td>
			<td>31</td>
			<td>32</td>
			<td>33</td>
			<td>34</td>
			<td>35</td>
		  </tr>
		  <tr>
			<td>5</td>
			<td colspan="2">sfdsf</td>
			<td>ffsf</td>
			<td>fsfsd</td>
			<td>41</td>
			<td>42</td>
			<td>43</td>
			<td>44</td>
			<td>45</td>
		  </tr>
		  <tr>
			<td>6</td>
			<td colspan="2">fsdfsd</td>
			<td>sfdsf</td>
			<td>ffsf</td>
			<td colspan="3">fsfsd</td>  
			<td>54</td>
			<td>55</td>
		  </tr>
		</table>
	</div>
</td>
</table>
</body>
</html>
[+][-]10.21.2008 at 10:58PM PDT, ID: 22773760

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.21.2008 at 11:01PM PDT, ID: 22773772

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.21.2008 at 11:11PM PDT, ID: 22773797

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.21.2008 at 11:28PM PDT, ID: 22773861

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.21.2008 at 11:32PM PDT, ID: 22773873

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.21.2008 at 11:41PM PDT, ID: 22773897

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628