•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,774 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,502 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1689 | Replies: 0
![]() |
•
•
Join Date: Jul 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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.
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.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- Windows 2000 - Windows Explorer folder view is gone (Windows NT / 2000 / XP / 2003)
- Dlink router blocking hotmail (Networking Hardware Configuration)
- Virus Problem (Viruses, Spyware and other Nasties)
- What Forum Do You Use? (Growing an Online Community)
- Windows XP Plug N Play problem (Windows NT / 2000 / XP / 2003)
- can't view offline webpages (Web Browsers)
- Msn Messenger Won't Work (Windows Software)
- Need help removing hotoffers.info ... (Viruses, Spyware and other Nasties)
- Can't open messages from Hotmail (Web Browsers)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Need to find a solution similar to Yahoo News related search
- Next Thread: Printing using Web Control Print button VB.NET


Linear Mode