473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Get the Top value

Hi,

I want to make the div tag , come along the screen as we scroll up, or down, left or right

Can you help me out.

Thanks in Advance.....!!!!
Jan 29 '10 #1
4 2351
Dormilich
8,658 Expert Mod 8TB
CSS – position: fixed; (along with top/left)
Jan 29 '10 #2
Hi,

Thanks for your reply,

but when i am changing the position to fixed, it is not reflected in IE6, on the other hand it is disturbing whole alignment., its working fine in Firefox 3.5

For reference please check the following code


Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Untitled Document</title>
  6. <script type="text/javascript">
  7. function show()
  8. {
  9.     document.getElementById('window').style.display='block';
  10.     document.getElementById('id_blank_div').style.display='block';
  11.     document.getElementById('id_blank_div').style.opacity='0.7'; 
  12.     document.getElementById('id_blank_div').style.background='#000000'; 
  13. }
  14. function hideEdit()
  15.     {
  16.         document.getElementById('window').style.display = 'none';
  17.         document.getElementById('id_blank_div').style.display='none';
  18.         document.getElementById('id_blank_div').style.opacity='0';         
  19.         document.getElementById('id_blank_div').style.background='none';
  20.     }
  21. </script>
  22. <style type="text/css">
  23. #id_blank_div{
  24.     top:0px;
  25.     border : 1px solid #525252;
  26.     background : #000000; 
  27.     width : 100%;
  28.     left:0px;
  29.     height:100%;
  30.     position:absolute;
  31.     padding-top:0px;
  32.     padding-bottom:0px;
  33.     display: none;
  34.     filter:alpha(opacity=50);
  35.     z-index:100;
  36. }
  37.  
  38. #window
  39. {
  40.     border : 1px solid #525252;
  41.     background : #FFFFFF; 
  42.     width : 950px;
  43.     display : none;
  44.     left : 25px;
  45.     top : 250px;
  46.     height:auto;
  47.     position:absolute;
  48.     padding-top:0px;
  49.     padding-bottom:0px;
  50.     z-index:200;
  51. }
  52. </style>
  53. </head>
  54.  
  55. <body>
  56. <table width="990" border="0" cellpadding="0" cellspacing="0" style="padding:0px">
  57.  
  58.     <tr>
  59.         <td>
  60.             <input type="button"  onclick="javascript:show();"  value="Click me"/>
  61.         </td>
  62.     </tr>
  63.     <tr>
  64.         <td>234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br />234<br /></td>
  65.         </tr>
  66.     <tr>
  67.         <td>
  68.             <div id="id_blank_div" ></div>
  69.             <div id="window" >
  70.                 <div id="div_title"><span id="window_title">Update Details</span>
  71.                             <span id="close"><a href="#" onClick="hideEdit()">Close X</a></span>
  72.                 </div>
  73.                 <table width="990" id="edit_window" > 
  74.                     <tr style="text-align:center;" >
  75.                         <td>Header</td><td>Header</td><td>Header</td><td>Header</td><td>Header</td><td>Header</td><td>Header</td>
  76.                     </tr>
  77.                     <tr>
  78.                         <td><input type="text"></td><td><input type="text"></td><td><input type="text"></td><td><input type="text"></td><td><input type="text"></td><td><input type="text"></td><td><input type="text"></td>
  79.                     </tr>
  80.                             </td>
  81.                     </tr>
  82.                         </table>
  83. </body>
  84. </html>
  85. <script type="text/javascript">
  86. var myWidth = 0, myHeight = 0;
  87.   if( typeof( window.innerWidth ) == 'number' ) {
  88.     //Non-IE
  89.     myWidth = window.innerWidth;
  90.     myHeight = window.innerHeight;
  91.   } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
  92.     //IE 6+ in 'standards compliant mode'
  93.     myWidth = document.documentElement.clientWidth;
  94.     myHeight = document.documentElement.clientHeight;
  95.   } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
  96.     //IE 4 compatible
  97.     myWidth = document.body.clientWidth;
  98.     myHeight = document.body.clientHeight;
  99.   }
  100.   document.getElementById('id_blank_div').style.height= (myHeight) + 'px';
  101. </script>

I have also attached a zip file of what i am trying.......!!!

Thanks in advance.........!!!!
Attached Files
File Type: zip temp.zip (1.5 KB, 62 views)
Jan 29 '10 #3
Dormilich
8,658 Expert Mod 8TB
but when i am changing the position to fixed, it is not reflected in IE6,
that’s stupid IE. you have to fix that manually (with JavaScript) or just ignore IE6.
Jan 29 '10 #4
acoder
16,027 Expert Mod 8TB
Search for "position fixed ie6" and you should find a fix - that is if you really need to support that browser, of course.
Feb 1 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
3
by: otto | last post by:
i need to read a variable in a javascript and translate it to a form in html the javascript variable is: <SCRIPT LANGUAGE='JavaScript'>RF2N('Total');</script> and i need to put that...
3
by: Eric Chang | last post by:
I was working on this simple form with radio boxes. And when I click on one of the radio box, it tell me the value is "undefined" Why is that ? I did defined the value of each radio box: ...
16
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not...
13
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the...
0
by: tania | last post by:
i have this table in my database: CREATE TABLE FILM( F_ID INT(5) NOT NULL AUTO_INCREMENT, F_TITLE VARCHAR(40) NOT NULL, DIRECTOR_FNAME VARCHAR(20) NOT NULL, DIRECTOR_LNAME VARCHAR(20) NOT NULL,...
1
by: cbellew | last post by:
Hi guys, I have a problem with an option group and a two corresponding text boxes. When the user chooses an option value i want the text boxes to populate with text dependent on the choice made....
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
2
vivekgs2007
by: vivekgs2007 | last post by:
Hi i am doing a application that add the rate of the staff evaluation please go through o=it and need help <?php include("../db.php"); session_start(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD...
10
by: Vivekneo | last post by:
Hi I am very new to web programming, trying to achieve a task, I have a form with 3 dropdown box and a text field(which is readonly). My problem now is, after selecting the above 3 dropdown boxes,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.