How to set page height dynamically for iscroll

115 views
Skip to first unread message

טוביה חוסיד

unread,
Jul 14, 2015, 7:09:12 AM7/14/15
to isc...@googlegroups.com


!Hi everybody
I use iscroll! It works wonderfull but i can not find solutuin for some issue: i can not set div height for scrolling dynamically for ipad. 
This is my html:
<div id="devicesContent"  ng-click="closeDrawer()">
<div id="tableContainer" >
<table id="devicesContainer" >
</table>
</div>
</div>

 
This is my javascript:

for (var i = 0; i < appData.ListItems[parkIndex].Devices.length; i++) {
var device = appData.ListItems[parkIndex].Devices[i];
device.index = i
//deviceTemplate+="<td onclick='getCommandList("+parkIndex+","+i+","+device.Type+")' ><div id='device."+device.ID+"' class=deviceTableCell><img onclick='getCommandList("+parkIndex+","+i+","+device.Type+")' id=device"+i+" class=centerText src=images/type"+device.Type+".png></div><div class=centerText>"+device.Name+"</div></td>";
deviceTemplate += "<td ><a onclick='getCommandList(" + parkIndex + "," + i + "," + device.Type + ")' class=deviceTableCell kendo-mobile-button id='device" + device.ID + "' class=deviceTableCell><img onclick='getCommandList(" + parkIndex + "," + i + "," + device.Type + ")' id=device" + i + " class=centerText src=images/type" + device.Type + ".png></div><div class=centerText>" + device.Name + "</a></td>";
if ((i + 1) % 4 == 0 || (i + 1) == appData.ListItems[parkIndex].Devices.length) {
deviceTemplate = "<tr>" + deviceTemplate + "</tr>";
$("#devicesContent table").append(deviceTemplate);
deviceTemplate = "";
}
} 

Maybe it is not so clear from the code but the issue here that i can have different heights for scrolling area. It depends of the table size.
And this is my css for height of scrolling area:

#tableContainer{
height:3750px
}
#devicesContent{
display: inline-block;
position: absolute;
top: 56px;
left: 0;
z-index: 1;
overflow: scroll;
}
If i set height statically like here
#tableContainer{
height:3750px
}
it works wonderful. But i want to set it dynamically. And it doesn't work for ipad. I mean that i want to set height for #tableContainer in javascript. I have tryed different tricks but it doesn't work for ipad. It works for desktop.

Thanks for help! 
Reply all
Reply to author
Forward
0 new messages