Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 25th, 2008, 08:07 AM
Registered User
 
Join Date: May 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to anantdev
Default overlapping Parent div Scroll bar

Hi All,
i've nested HTML Div, parent Div is having horizontal Scroll bar,
child Div contains TextArea with some larger size than parent. BUT the textArea is going behind the scroll bar. i want to textArea on the top of parent scroll bar.
 For better understanding look at the bellow HTML Code snippet.
<script language="JavaScript">
function showExpandedTextArea(){
     var expandedTextAreaDivVar = document.getElementById('expendedtextarea_div');
     var id_parentVar = document.getElementById('id_parent');
     expandedTextAreaDivVar.style.display="";
     var divTextarea = document.getElementById('expandedTextArea_0');
}
</script>
<style type="text/css">
div.scrollable
{ font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #FF00FF;height:150;border:1px solid;width :350; scrollbar-3dlight-color:black;position:absolute; scrollbar-arrow-color:black; overflow : hidden; overflow: scroll; overflow-y:hidden;}
</style>
<div class="scrollable" id="id_parent" >
    <table id="expendedtextarea_div" style="position:relative;display:none; left:30; top:80" border="0">
<tr nowrap bgcolor="white">
  <td colspan="2" valign="top">
    textarea<TEXTAREA NAME="expandedTextArea_0" ROWS="5" COLS="15"></TEXTAREA></td></tr></table>
<div id="div_2" style="position:absolute;left:0; top:34">
<table> <tr><td nowrap>
PH<TEXTAREA name="minValText_0" rows="1" cols = "22" ></TEXTAREA> <INPUT TYPE="image" SRC="\arrow.gif" onclick=showExpandedTextArea();></td></tr></table>
</div>
</div>

anant
 
Old July 28th, 2008, 09:14 AM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try adding the px to height and width styles.

height: 150px; width: 350px;



Shawn Steward
Web Developer
www.shawnsteward.com
 
Old July 28th, 2008, 10:20 PM
Registered User
 
Join Date: May 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to anantdev
Default

Hi,

i guess you didn't get my problem exactly. i want textArea should prompt on the top of horizontal scroll bar. is there anyway we can overlap scrollbar with textArea(we are using nested DIV respectively). situation is like that we cant increase width or we can't use vertical scrollbar.

anyway we have to overlap textArea on the top of scrollbar..?


please help me out.
i would be highly greatful if you try to resolve this.



anant
 
Old July 29th, 2008, 09:17 AM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm really not sure exactly what you're trying to accomplish... If I understand you right, here is how you can use absolute positioning to put the small textarea (PH) on top of the horizontal scrollbar of the id_parent div. Trying to figure out what you're trying to do with the javascript but not quite following it...

<script language="JavaScript">
function showExpandedTextArea(){
    var expandedTextAreaDivVar = document.getElementById('expendedtextarea_div');
    var id_parentVar = document.getElementById('id_parent');
    expandedTextAreaDivVar.style.display="";
    var divTextarea = document.getElementById('expandedTextArea_0');
}
</script>
<style type="text/css">
div.scrollable{
    height:150px;
    border:1px solid;
    width :350px;
    position:absolute;
    overflow-x: scroll;
}
</style>

<div class="scrollable" id="id_parent">
    textarea<TEXTAREA NAME="expandedTextArea_0" ROWS="5" COLS="15"></TEXTAREA>
</div>
<div id="div_2" style="position:absolute;left:40px; top: 134px;">
    PH<TEXTAREA name="minValText_0" rows="1" cols = "22" ></TEXTAREA><INPUT TYPE="image" SRC="\arrow.gif" onclick="showExpandedTextArea();">
</div>


Shawn Steward
Web Developer
www.shawnsteward.com
 
Old August 11th, 2008, 06:21 AM
Registered User
 
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In my opinion Try adding the px to height and width styles.
  height: 150px; width: 350px;






Similar Threads
Thread Thread Starter Forum Replies Last Post
Div Scroll problem in Firefox sigilaea ASP.NET 2.0 Professional 0 December 19th, 2007 10:33 AM
Div won't scroll in Firefox? sigilaea ASP.NET 2.0 Basics 0 December 18th, 2007 10:23 PM
IFrame forces parent to scroll kend HTML Code Clinic 1 September 18th, 2003 07:46 PM
How can I make two scroll bar to be the same one? Daniel_hn Visual C++ 1 September 16th, 2003 09:28 AM
Scroll Bar cooldude87801 BOOK: Beginning Java 2 0 June 18th, 2003 11:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.