Problem with View More Messages title appearing

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jul 2005
Posts: 1
Reputation: Pankaja is an unknown quantity at this point 
Solved Threads: 0
Pankaja Pankaja is offline Offline
Newbie Poster

Problem with View More Messages title appearing

 
0
  #1
Jul 7th, 2005
Hi All

I am hoping someone can help me out since this is driving me nuts.

On my ASP.Net page I have DIV areas and one ASP.Net server label control :


Code:
_DIV area 1_____________________________________________________
Message Center View All Messages|
_DIV area2_____________________________________________________
(lblMsgCenter)
This is first test message. |
|
This is 2nd test message. |
_______________________________________________________

The scroll bar of the 2nd DIV area appears if the messages increase beyond the height of the DIV area. That is not a problem, and the View All Messages hyperlink shows up in the first DIV area. When the messages are less and within the DIV height, scroll bar should not appear and the View All Messages hyperlink in the first DIV area shouldn't show up. The problem is - it shows up. Please help me. This is the snippet of my code:

<script language="JavaScript" id="ViewMore" type="text/javascript">
function lib_bwcheck(){ //Browsercheck (needed)
this.ver=navigator.appVersion
this.agent=navigator.userAgent
this.dom=document.getElementById?1:0
this.opera5=this.agent.indexOf("Opera 5")>-1
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom &&
!this.opera5)?1:0;
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !
this.opera5)?1:0;
this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
this.ie=this.ie4||this.ie5||this.ie6
this.mac=this.agent.indexOf("Mac")>-1
this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 ||
this.opera5);
// 07/05/05 - added by PS
//alert('lib_bwcheck call');
// end
return this;
}

//var bw=new lib_bwcheck();
function makeObj(obj,nest){
var bw=new lib_bwcheck();

if(!bw.bw) return lib_message('Old browser')
nest=(!nest) ? ""'document.'+nest+'.');
this.el=bw.dom?document.getElementById(obj):bw.ie4?
document.all[obj]:0;
this.css=bw.dom?document.getElementById(obj).style:bw.ie4?
document.all[obj].style:0;
this.offsetHeight=this.el.offsetHeight;
this.scrollHeight=this.el.scrollHeight;
this.obj = obj + "Object";
return this;
}

//Makes the object
function ViewMoreMsgInit(){
oCont = new makeObj('divMsgArea');
oMore = new makeObj('divMore');
alert('in ViewMoreMsgInit');

if ( oCont.scrollHeight > oCont.offsetHeight)
oMore.css.visibility = "visible";
else
oMore.css.visibility = "hidden";
}

</script>
</HEAD>
<body>
<table class="spreadsheet wide">
<tr>
<th class="mergeRight metaHeading cell">
Message Center</th>
<th class="mergeLeft metaHeading cell" id="TH1">
<div class="cell" id="divMore" align="right" runat="server"><a id=vAll
href="<%=ViewDetail()%>"
Runat="server">View All Messages</a></div>
</th>
</tr>
<tr>
<td class="cell" id="tdMsgArea" colSpan="2">
<div id="divMsgArea" style="OVERFLOW: auto; HEIGHT: "150px">
<asp:label id="lblMsgCenter" Runat="server"></asp:label></div>
</td>
</tr>
</table>
<script>
ViewMoreMsgInit()
</script>
</body>

Note: The 'lblMsgCenter' is getting filled up in the server-side code in the Form Page_Load event.

I would appreciate if whoever has a suggestion to please post their reply and also send me an e-mail to pankaja_shankar@ml.com

Thanks.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC