473,657 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Css Hide show problem

1 New Member
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 1965
Markus
6,050 Recognized Expert Expert
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
74074
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 Form1.Visible = False Load (Form1)
10
3201
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 layer behind the menus. The closer div has a lower index than the submenu divs so it appears behind them. The closer div contains a transparent gif with an event applied to it to close all of the divs when moused over.
10
4643
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 with the javascript in a toggle fashion. the problem is a know very little javascript and have become incredibly frustrated because i went ahead thinking it was going to be like C. its not. I know i can use these lines to do the actual work:
2
12182
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 { display: none; }
0
2094
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 some stuff in the main display area. The stuff to display is one of many assemblies loaded at the opening of the application by Activator.CreateInstance, because I want it independant of the main application, as a plugin. All assembly are loaded...
5
8425
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 form tags and div elements say n. The problem
1
4164
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. I don`t want to change the way i have used to show and hide layers. check down code :- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
10
11748
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. It seems the simplest thing is to run the code (see below) once with the detail section showing, and a second time hiding the detail section. I can't figure out the code to do that and don't see it posted.
18
7550
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 rows and 2 columns. I would like on page load to only have one row visible with the bottom two rows hidden. I would like to have an "add" button on the bottom most visible row. When you click the "add" button it adds a row to the bottom and moves the...
18
4844
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 starting divs on my page, each one expanding onclick. The show/hide elemant works fine. There is one slight problem... I want the user to be able to click anywhere inside the starting div in order for the hidden div to be revealed. This is ok for the...
0
8326
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8845
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8743
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8622
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2745
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.