473,320 Members | 2,048 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,320 software developers and data experts.

Css Hide show problem

1
i have the images i want it to display down of the list only .Please some one help me


Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3.  
  4. <html>
  5. <head>
  6.  
  7. <style type="text/css">
  8.  
  9. body{
  10.     font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif;    /* Font to use */
  11.     margin:0px;
  12.  
  13. }
  14.  
  15. .dhtmlgoodies_question{    
  16.     /* Start layout CSS */
  17.  
  18.     color:#FFF;
  19.     font-size:0.9em;
  20.     background-color:#F46200;
  21.     width:200px;
  22.     margin-bottom:2px;
  23.     margin-top:2px;
  24.     padding-left:2px;
  25.  
  26.     background-repeat:no-repeat;
  27.     background-position:top right;    
  28.     height:20px;
  29.     overflow:hidden;
  30.     cursor:pointer;
  31.     position:inherit;
  32.     float:left;
  33. }
  34. .img{    /* Parent box of slide down content */
  35.     /* Start layout CSS */
  36.  
  37.     border:1px solid #317082;
  38.     background-color:#E2EBED;
  39.     width:400px;
  40.  
  41.     /* End layout CSS */
  42.  
  43.     visibility:hidden;
  44.     height:0px;
  45.     overflow:hidden;
  46.     position:relative;
  47.     width:300;
  48.  
  49.  
  50. }
  51. .dhtmlgoodies_answer_content{    /* Content that is slided down */
  52.     padding:1px;
  53.     font-size:0.9em;    
  54.     position:relative;
  55.     cursor:default;
  56.  
  57. }
  58.  
  59.  
  60.  
  61. </style>
  62. <script type="text/javascript">
  63.  
  64. var dhtmlgoodies_slideSpeed = 10;    // Higher value = faster
  65. var dhtmlgoodies_timer = 10;    // Lower value = faster
  66.  
  67. var objectIdToSlideDown = true;;
  68. var dhtmlgoodies_activeId = false;
  69. var dhtmlgoodies_slideInProgress = false;
  70. function showHideContent(e,inputId)
  71. {
  72.     if(dhtmlgoodies_slideInProgress)return;
  73.     dhtmlgoodies_slideInProgress = true;
  74.     if(!inputId)inputId = this.id;
  75.     inputId = inputId + '';
  76.     var numericId = inputId.replace(/[^0-9]/g,'');
  77.     var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);
  78.  
  79.     objectIdToSlideDown = false;
  80.  
  81.     if(!answerDiv.style.display || answerDiv.style.display=='none'){        
  82.         if(dhtmlgoodies_activeId &&  dhtmlgoodies_activeId!=numericId){            
  83.             objectIdToSlideDown = numericId;
  84.             slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));
  85.         }else{
  86.  
  87.             answerDiv.style.display='block';
  88.             answerDiv.style.visibility = 'visible';
  89.  
  90.             slideContent(numericId,dhtmlgoodies_slideSpeed);
  91.         }
  92.     }else{
  93.         slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));
  94.         dhtmlgoodies_activeId = false;
  95.     }    
  96. }
  97.  
  98. function slideContent(inputId,direction)
  99. {
  100.  
  101.     var obj =document.getElementById('dhtmlgoodies_a' + inputId);
  102.     var contentObj = document.getElementById('dhtmlgoodies_ac' + inputId);
  103.     height = obj.clientHeight;
  104.     if(height==0)height = obj.offsetHeight;
  105.     height = height + direction;
  106.     rerunFunction = true;
  107.     if(height>contentObj.offsetHeight){
  108.         height = contentObj.offsetHeight;
  109.         rerunFunction = false;
  110.     }
  111.     if(height<=1){
  112.         height = 1;
  113.         rerunFunction = false;
  114.     }
  115.  
  116.     obj.style.height = height + 'px';
  117.     var topPos = height - contentObj.offsetHeight;
  118.     if(topPos>0)topPos=0;
  119.     contentObj.style.top = topPos + 'px';
  120.     if(rerunFunction){
  121.         setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);
  122.     }else{
  123.         if(height<=1){
  124.             obj.style.display='none'; 
  125.             if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
  126.                 document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block';
  127.                 document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible';
  128.                 slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed);                
  129.             }else{
  130.                 dhtmlgoodies_slideInProgress = false;
  131.             }
  132.         }else{
  133.             dhtmlgoodies_activeId = inputId;
  134.             dhtmlgoodies_slideInProgress = false;
  135.         }
  136.     }
  137. }
  138.  
  139.  
  140.  
  141. function initShowHideDivs()
  142. {
  143.     var divs = document.getElementsByTagName('DIV');
  144.     var divCounter = 1;
  145.     for(var no=0;no<divs.length;no++){
  146.         if(divs[no].className=='dhtmlgoodies_question'){
  147.             divs[no].onclick = showHideContent;
  148.             divs[no].id = 'dhtmlgoodies_q'+divCounter;
  149.             var answer = divs[no].nextSibling;
  150.             while(answer && answer.tagName!='DIV'){
  151.                 answer = answer.nextSibling;
  152.             }
  153.             answer.id = 'dhtmlgoodies_a'+divCounter;    
  154.             contentDiv = answer.getElementsByTagName('DIV')[0];
  155.             contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px';     
  156.             contentDiv.className='dhtmlgoodies_answer_content';
  157.             contentDiv.id = 'dhtmlgoodies_ac' + divCounter;
  158.             answer.style.display='none';
  159.             answer.style.height='1px';
  160.             divCounter++;
  161.         }        
  162.     }    
  163. }
  164. window.onload = initShowHideDivs;
  165. </script>
  166. </head>
  167. <body>
  168.  
  169.  
  170. <div  align="left" class ="dhtmlgoodies_question">New Products</div>
  171.  
  172.     <div id="img">
  173.     <div class="dhtmlgoodies_answer">
  174.         <img src="images2.jpg"/>
  175.         <img src="images6.jpg"/>
  176.         </div>
  177.  
  178.     </div>
  179. <div align="left" class="dhtmlgoodies_question">Hot Products</div>
  180.  
  181.     <div class="dhtmlgoodies_answer">
  182.     <div  id="Hot Products">
  183.         <img src="images1.jpg"/>
  184.         <img src="images5.jpg"/>
  185.     </div>
  186.     </div>
  187.  
  188. <div align="left" class="dhtmlgoodies_question">Comming soon</div>
  189.  
  190.     <div class="dhtmlgoodies_answer">
  191.     <div  id="coming soon">
  192.         <img src="images3.jpg"/>
  193.         <img src="images4.jpg"/>
  194.     </div>
  195.     </div>
  196.  
  197. </body>
  198. </html>
Oct 21 '08 #1
1 1940
Markus
6,050 Expert 4TB
Hey there, Anu and welcome to the forums.

When posting code on the forums, be sure to use [code] tags. [code] .. code goes here [/code]. If you neglect to do so, you will be given a warning and possibly a temporary ban. Please read the Posting Guidelines on How To Ask A Question

Markus.
Oct 21 '08 #2

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

Similar topics

13
by: genetic.error | last post by:
I'm moving from Vb6 to VB.Net. I have a feeling this has come up before... The VS.Net MSDN file seems to state that the following should work: Form1.Show Form1.Visible = True Form1.Hide...
10
by: David | last post by:
Hi everyone, Hoping there are some .js/browser experts out there that can help with this weird problem. I have made a swap div routine and applied the events to menu buttons with a closer...
10
by: oLE | last post by:
I would like to add some javascript to show/hide a certain row of a table. The first row of the table contain the hyperlink that calls the javascript the second row is the one i want to show/hide...
2
by: MOHSEN KASHANI | last post by:
Hi, I am trying to hide some form elements in a form by default and show/hide depending on which radio button is clicked. This is what I have but it is not working: <head> <style> ..noshow {...
0
by: Efkas | last post by:
I have a full custom application with some widged extending Controls like Label and PictureBox. I build a menu with these widgets. When I click on one of them, it calls a function to display...
5
by: ali | last post by:
Hello every one i need you help regarding div hide and show. i am having a link like <a href="#" onClick="expandWin()">show/hide </a> <div id=showHide> </div> within div i have lots of...
1
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
10
by: sara | last post by:
Hi - Is it possible to hide the detail section of a report at run time? I have a report that prints all details, with summary lines. The user would like the report ALSO with just summary lines....
18
by: Liquidtouch | last post by:
I have been searching on this for awhile and cant find anything and playing around with it got me no where. I will start with what I am after and then explain what I have. I have a table with 3...
18
by: ryrocks | last post by:
Hi, Im making a 'contact us' page. The user click on the div, this then reveals another larger div displaying more information giving the effect of the box expanding or dropping down. I have 3...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.