This page was last modified 23:21, 14 May 2008.
How to resolve the problem of both of the div were shown But we just want to show only the first div
From Forum Nokia Wiki
Compatibility: Web Runtime in S60 3rd Edition, Feature Pack 2
How to resolve the problem of both of the div were shown But we just want to show only the first div
Contents |
Problem
Most of the time, we use two div in order to change the view showed to user. But I found an unpleasant phenomena when use two div in the below way. It would appear both of the view in a first flash for a very short time. And then the second view was hide.
Code in html caused the problem
In the main html file: Add this to the second view: style="visibility:hidden;"
<div id="firstView"> <TABLE> <TR> <TD> Some things. </TD> </TR> <TR> <TD> more things. </TD> </TR> </TABLE> </div> <div id=secondView style="visibility:hidden;"> <TABLE> <TABLE> <TR> <TD> Some things in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> </TABLE> </div>
Code in js file caused the problem
In the js file, we use this method to change the view:
document.getElementById("secondView").style.display = "none";
document.getElementById("firstView").style.display = "block";
Solution
In order to avoid the shown of two div in the same time for very short time. We could use below method to just show the first view. The second view not be shown at all.
Code in html could solve the problem
In the main html file:
<div id="firstView"> <TABLE> <TR> <TD> Some things. </TD> </TR> <TR> <TD> more things. </TD> </TR> </TABLE> </div> <div id=secondView > <TABLE> <TABLE> <TR> <TD> Some things in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> <TR> <TD> many more rows in the second view. </TD> </TR> </TABLE> </div>
Code in js file could solve the problem
In the js file, we use this method to change the view:
function showFirstView()
{
document.getElementById("sitesView").style.display = "none";
document.getElementById("tickerView").style.display = "block";
}
function showSecondView(){
document.getElementById("sitesView").style.visibility="visible";
window.widget.prepareForTransition("fade");
document.getElementById("tickerView").style.display = "none";
document.getElementById("sitesView").style.display = "block";
setTimeout("window.widget.performTransition();", 1);
menu.clear();
}
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Please help me, error appendL TBuf to CDesC16Array | DreadLord | General Symbian C++ | 18 | 2007-11-28 15:40 |
| how to clear a screen?...... | bharats | Symbian User Interface | 2 | 2007-04-09 13:20 |
| Info note not shown | saamm | General Symbian C++ | 2 | 2007-10-10 09:16 |
| file select dialog的问题 | wangfei406 | Symbian | 13 | 2005-12-29 03:32 |
| How to show sms body preview | comunicando | Symbian Tools & SDKs | 1 | 2002-12-20 12:33 |
