944,066 Members | Top Members by Rank

Ad:
Jul 7th, 2005
0

Problem with View More Messages title appearing

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Pankaja is offline Offline
1 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Need to find a solution similar to Yahoo News related search
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Dropdown menu





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC