JavaScript - Hide/show Div Javascript Iframes Wont Work In Ie
Hi,
I've created a gallery with multiple slideshows; each of them show/hide when you click on their corresponding link. The first slideshow appears when the page loads, but the others are hidden with a div style. It works great in most browsers, except Internet Explorer . For some reason, IE only shows part of the slideshows; the whole iframe is there, but only a small portion of the photos appear (although the slideshow itself also continue to run fine). I realized that the problem is the div style (style="display:none; ). When I remove it from all the slideshows, then they appear fully instead of partially in Internet Explorer. However, the purpose of hiding them is defeated, as they all show up at once when the page loads. I want to keep them all hidden until you click on their respective link to show them. The page can be viewed he www.raynemakerimages.com/galleries.html Firefox shows how it should display.... Anyway, I'm looking for a relatively easy fix for this....help is appreciated. Thanks. Coding: Code: <script type="text/javascript" language="JavaScript"> <!-- function HideContent(d) { document.getElementById(d).style.display = "none"; } function ShowContent(d) { document.getElementById(d).style.display = "block"; } function ShowContent(d) { if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; } else { document.getElementById(d).style.display = "none"; } } //--> </script> The hide/show links: Code: <div align="center" class="class1"> <a href="javascript:ShowContent('family'), HideContent('artistic'),HideContent('intimate'),HideContent('maternity'),HideContent('newborns'),HideContent('miscellaneous')" class="style1 style32"> <span class="class1">Family </span></a> | <a href="javascript:ShowContent('artistic'), HideContent('family'),HideContent('intimate'),HideContent('maternity'),HideContent('newborns'),HideContent('miscellaneous')" class="style1 style32"> Artistic </a> | <a href="javascript:ShowContent('intimate'), HideContent('family'), HideContent('artistic'),HideContent('maternity'),HideContent('newborns'),HideContent('miscellaneous')" class="style1 style32"> Intimate </a> | <a href="javascript:ShowContent('maternity'), HideContent('family'), HideContent('artistic'),HideContent('intimate'),HideContent('newborns'),HideContent('miscellaneous')" class="style1 style32"> Maternity </a> | <a href="javascript:ShowContent('newborns'), HideContent('family'), HideContent('artistic'),HideContent('intimate'),HideContent('maternity'),HideContent('miscellaneous')" class="style1 style32">Newborns </a> | <a href="javascript:ShowContent('miscellaneous'), HideContent('family'), HideContent('artistic'),HideContent('intimate'),HideContent('maternity'),HideContent('newborns')" class="style1 style32"> Miscellaneous</a><a href="javascript:ShowContent('miscellaneous'), HideContent('family'), HideContent('artistic'),HideContent('intimate'),HideContent('maternity'),HideContent('newborns')" class="style1 style32"></a> </div> The slideshows: Quote: <table width="960" border="0" align="center" cellpadding="0" cellspacing="0" style="background-image: url(images/bg3.jpg)"> <tr> <td> <div id="family"> <p align="center"><span class="style33">Family Gallery</span><br /><iframe align="center" src="http://www.flickr.com/slideShow/index.gne?group_id=&user_id=57634260@N08&set_id=72157625563240423&tags=Family" frameBorder="0" width="700" height="700" scrolling="no"></iframe><br/></p></div> </td> </tr> <tr> <td> <div id="intimate" style="display:none;"><p align="center"><span class="style33">Intimate Gallery</span><br /><iframe align="center" src="http://www.flickr.com/slideShow/index.gne?group_id=&user_id=57634260@N08&set_id=72157625563795631&tags=Intimate" frameBorder="0" width="700" height="700" scrolling="no"></iframe><br/></p></div> </td> </tr> <tr> <td > <div id="artistic" style="display:none;"><p align="center"><span class="style33">Artistic Gallery</span><br /><iframe align="center" src="http://www.flickr.com/slideShow/index.gne?group_id=&user_id=57634260@N08&set_id=72157625563696337&tags=Artistic" frameBorder="0" width="700" height="700" scrolling="no"></iframe><br/></p></div> </td> </tr> <tr> <td> <div id="maternity" style="display:none;"><p align="center"><span class="style33">Maternity Gallery</span><br /><iframe align="center" src="http://www.flickr.com/slideShow/index.gne?group_id=&user_id=57634260@N08&set_id=72157625563996323&tags=Maternity" frameBorder="0" width="700" height="700" scrolling="no"></iframe><br/></p></div> </td> </tr> <tr> <td> <div id="newborns" style="display:none;"><p align="center"><span class="style33">Newborns Gallery</span><br /><iframe align="center" src="http://www.flickr.com/slideShow/index.gne?group_id=&user_id=57634260@N08&set_id=72157625563996817&tags=Newborns" frameBorder="0" width="700" height="700" scrolling="no"></iframe><br/></p></div> </td> </tr> <tr> <td> <div id="miscellaneous" style="display:none;"><p align="center"><span class="style33">Miscellaneous Gallery</span><br /><iframe align="center" src="http://www.flickr.com/slideShow/index.gne?group_id=&user_id=57634260@N08&set_id=72157625689475348&tags=Miscellaneous" frameBorder="0" width="700" height="700" scrolling="no"></iframe><br/></p></div> </td> </tr> </table> Similar TutorialsI want to be able to display a table of images, all the same size, click on any one and show a corresponding htm pages in an iframe, click outside the ifram or on it to close it; click on another image and on and on... So far, I am able to hide the initial iframe and/or display it inline but am unable to show it above the table that holds the images. It is not difficult to do this using screen-captured images of the htm pages but I am looking for a dynamic way of doing this either with javascript or php or just plain html. The htm pages contain a recipe with an photo and text in a <table>. If needed, I could whip up a small demo. Any help would be much appreciated. So I am trying to hide content and show it when selected with a select box. The first select box works fine no problems. However I added a second one with two options, and it will not work at all. If I use the same name it messes up, and if I make a new name, it does nothing at all. ShowNext function is the new one I added that doesn't work. PHP Code: <script type="text/javascript"> function ShowReg(op) { document.getElementById('public').style.display='none'; document.getElementById('alliance').style.display='none'; switch (op) { case 1 : document.getElementById('public').style.display="block"; break; case 2 : document.getElementById('alliance').style.display="block"; break; default : break; } } function ShowNext(op) { document.getElementById('randomwin').style.display='none'; document.getElementById('setentry').style.display='none'; document.getElementById('highestlevel').style.display='none'; document.getElementById('question').style.display='none'; switch (op) { case 1 : document.getElementById('randomwin').style.display="block"; break; case 2 : document.getElementById('setentry').style.display="block"; break; case 3 : document.getElementById('highestlevel').style.display="block"; break; case 4 : document.getElementById('question').style.display="block"; break; default : break; } } </script> PHP Code: <tr><td><b>Privacy:</b></td><td> <select name="privacy" id="choice" onChange="ShowReg(this.selectedIndex)"> <option value="error">Select One</option> <option value="public">Public</option> <option value="alliance">Alliance Only</option> </select> </td></tr></table><br /> <div id="public" style="display:none"> <p><b>Contest will be made Public for all players to use.</b> </div> <div id="alliance" style="display:none"> <p><b>Contest will be made available to only alliance members.</b> </div> <tr><td><b>Type:</b></td><td> <select name="contype" id="choice" onChange="ShowNext(this.selectedIndex)"> <option value="error">Select One</option> <option value="randomwin">Random Draw</option> <option value="setentry">Marked Entry</option> <option value="highestlevel">Highest Level</option> <option value="question">Answer Question</option> </select></td></tr></table><br /> <div id="randomwin" style="display:none"> <p>Random draw selected </div> <div id="winner" style="display:none"> <p>Select Entry number to auto win: <select name="entrypick"> <option value="5">Entry 5</option> <option value="6">Entry 6</option> <option value="7">Entry 7</option> <option value="8">Entry 8</option> <option value="9">Entry 9</option> <option value="10">Entry 10</option> <option value="11">Entry 11</option> <option value="12">Entry 12</option> <option value="13">Entry 13</option> <option value="14">Entry 14</option> <option value="15">Entry 15</option> <option value="16">Entry 16</option> <option value="17">Entry 17</option> <option value="18">Entry 18</option> <option value="19">Entry 19</option> <option value="20">Entry 20</option> <option value="21">Entry 21</option> <option value="22">Entry 22</option> <option value="23">Entry 23</option> <option value="24">Entry 24</option> <option value="25">Entry 25</option> <option value="26">Entry 26</option> <option value="27">Entry 27</option> <option value="28">Entry 28</option> <option value="29">Entry 29</option> <option value="30">Entry 30</option> </select> </div> hello! i created a javascript for opening a page on a new window and added it on an html file. i then used the said html file as the source of my iframe on a joomla page. but the javascript isnt working. any help? the said iframe is called Scroll News on this page: http://dumplingdesigns.freehostia.com/ thanks in advance! HTML: Code: <!-- video player begin --> <div id="playerHolder"> <div class="player" id="playerDiv"> <div id="playerwidget"></div> <div id="adCompanionBanner" style="visibility:hidden;"></div> </div> </div> In firefox, I type Code: javascript:document.getElementById("player").sendEvent(''SEEK", 0); into the Address bar and hit enter. Why doesn't it work? How do I correctly "seek" a video. hey i need help of all u guys.Actually the problem is that when i am loading this html page i just want the sign in page to appear and on click of cancel button i want a page to appear and on click of login button i get log in page..but the problem is that whenever i load my html page i get the sign in page and the page that is present on the cancel page..i tried showing and hiding and tried but i dnt know what more to do...please help me out.. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> </title> <link rel="stylesheet" type="text/css" href="styling.css"/> <script type="text/javascript" src="jquery-1.7.1.js"></script> <script type="text/javascript"> window.onload = function() { document.getElementById('first_div').style.display = 'none';} function toggle(link, div1id, div2id) { var div1 = document.getElementById(div1id); var div2 = document.getElementById(div2id); if (div1.style.display == 'none') { $('#third_div').hide(); div1.style.display = 'block'; div2.style.display = 'none'; link.innerHTML = 'Login'; } else { $('#third_div').hide(); div1.style.display = 'none'; div2.style.display = 'block'; link.innerHTML = 'signin'; } } function toggleImg(divId) { $('#first_div').hide(); $('#second_div').hide(); $('#third_div').show(); } </script> </head> <body> <div id="first_div" class="container"> <label for="username"> <span>Username:*</span> <input type="text" class="text" id="user" placeholder="Username" maxlength="24" onFocus="this.style.borderColor='#B0E0E6';" onBlur="this.style.borderColor='#D3D3D3';"/> </label> <label for="password"> <span>Password:*</span> <input type="password" class="text" id="pass" placeholder="Password" maxlength="24" onFocus="this.style.borderColor='#B0E0E6';" onBlur="this.style.borderColor='#D3D3D3';"/> </label> <label> <input type="checkbox" name="remember" id="remember" class="checkbox" value="1" tabindex="3" /> Remember Me? </label> <label> <input type="submit" name="submit" class="button1" id="doLogin" value="Sign in" /> </label> </div> <div id="second_div" class="container1"> <label for="username"> <span> Username:*</span> <input type="text" id="username" class="text" placeholder="Username" maxlength="24" onFocus="this.style.borderColor='#B0E0E6';" onBlur="this.style.borderColor='#D3D3D3';"/> </label> <label for="password"> <span>Password:*</span> <input type="password" id="password" class="text" placeholder="Password" maxlength="24" onFocus="this.style.borderColor='#B0E0E6';" onBlur="this.style.borderColor='#D3D3D3';"/> </label> <label for="repass"> <span>Re-Password:* </span><input type="password" id="repass" class="text" placeholder="Re-password" maxlength="24" onFocus="this.style.borderColor='#B0E0E6';" onBlur="this.style.borderColor='#D3D3D3';"/> </label> <label for="email_id"> <span>Email-Id:</span><input type="text" id="email_id" class="text" placeholder="Verify email-id" maxlength="24" onFocus="this.style.borderColor='#B0E0E6';" onBlur="this.style.borderColor='#D3D3D3';"/> </label> <label><input type="submit" name="submit" class="button1" value="Submit" /></label> </div> <div id="third_div" class="image"> <img src="https://gs1.wac.edgecastcdn.net/8019B6/data.tumblr.com/tumblr_m2rdcqQLrA1qcb6kno1_500.jpg" /> </div> <div class="header"> <button class="button_cancel" onclick="toggleImg('third_div');">Cancel</button> <button class="button_sign" id="sign" onclick="toggle(this,'first_div', 'second_div'); return false;">Sign_in</button> </div> </body> </html> I wanted it according to this website https://www.tumblr.com Hey, I wonder how I'm going to do when it comes to the function of "show/hide" with JavaScript. My question is: I'm working on a web form. The following question is on the form: "Was ITK used?", and you're supposed to be able to pick "Yes" or "No" (by radio buttons), and this I've already fixed with no issues. But what I CAN'T do, for some strange reason, is that when you've clicked "Yes" on that question, it should appear another question: "Does customer have ITK in their network?", and when that comes up you're supposed to choose between "Yes"/"No" with radio buttons there as well. BUT if you click "No" on the first question (Was ITK used?), the other question (Does customer have ITK in their network?) shouldn't appear... Do you understand what I mean? How do I do this? Thanks in advance! Hello everyone. I am building a subscription directory website and I need help developing a code that will perform this function: I want to be able to hide certain spans when another span appears on the page. In other words, the page will normally display <span id="spanA"> and <span id="spanB">. However, when <span id="spanC"> appears on a page, I want to set display:none for spanA and spanB. I know how to toggle between display:none and display:block using a call to a javascript function like a link with an "onClick" Perhaps there a way I could code a span in CSS to toggle this javascript function when it appears on the page? Thank you for any help! Hi I am trying to implement a hide/show div, such that when you mouse over a div, another div pop's up below it. Here's what I have so far, but for some reason, only the first div set is working. That is when I mouse over div 1, div 2 shows up. So why isnt it working for divs 3,4 and 5,6? Here's my code: Code: HTML <div > <div id="showhide"> Line 1 </div> <div id="visiblediv" style="display: none;"> Line 2 </div> </div> <div > <div id="showhide"> Line 3 </div> <div id="visiblediv" style="display: none;"> Line 4 </div> </div> <div > <div id="showhide"> Line 5 </div> <div id="visiblediv" style="display: none;"> Line 6 </div> </div> Javascript: <script> function mover(){ document.getElementById("visiblediv").style.display="block" } function mout() { document.getElementById("visiblediv").style.display="none" } document.getElementById('showhide').onmouseover=mover; document.getElementById('showhide').onmouseout=mout; </script> CSS: #visiblediv { visibility:visible; border:1px dotted black; } Any ideas, as to why it's not working? Hello, I am pretty unfamiliar with javascript and jquery but have thus far been able to scrape by. I am currently trying to set up an image toggle using show/hide inside of an overlay window that pops up when a button inside the site is clicked. The trouble I am having is that when the overly initially opens up, neither image that I am trying to toggle will show up, but once the thumbnails that I am using to control them are clicked, the image toggle works perfectly. I am using the #rImg1 and #lImg1 id's as the toggle buttons between showing the #rightFacingImg1 and the #leftFacingImg1 id's. My goal is to pull up the overlay window with the #rightFacingImg1 as the default image, so that the main image area is never left blank. Here is the code that I am using: Java for overlay: Code: $(document).ready(function() { $("img[rel]").overlay(); }); Java for show/hide: Code: $(document).ready(function() { $.fx.off = !$.fx.off; $('#rightFacingImg1').click(function() { $('.hideme').css({'display':'none'}); $('#rImg1').show('slow'); }); $('#leftFacingImg1').click(function() { $('.hideme').css({'display': 'none'}); $('#lImg1').toggle('slow'); }); }); html that calls the overlay box: Code: <div class="img"> <img src="images/Rifles/browningm53r.jpg" alt="" width= "225" rel="#lightboxrifle1"/> <div class="desc"><p><b>Browning M53</b> <br/>Price: $600.00</p></div> </div> html inside overlay: Code: <div class="lightboxriflegen" id="lightboxrifle1"> <img src="images/x.jpg" alt="" id="rifleclose" class="close"/> <div class="bigpic"> <img id="rImg1" class="hideme" src="images/Rifles/browningm53r.jpg"alt="" width="720px" /> <img id="lImg1" class="hideme" src="images/Rifles/browningm53l.jpg"alt="" width="720px" /> </div> <div class="geninfo"> <b>Browning M53</b><br/> 32-20 Calibur<br/> Lever Action.<br/> Condition: New </div> <div class="genprice"> <b>Price: $600.00</b> </div> <div class="littler"> <img id="rightFacingImg1" src="images/Rifles/browningm53r.jpg" alt="" width="150px" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40"/> </div> <div class="littlel"> <img id="leftFacingImg1" src="images/Rifles/browningm53l.jpg" alt="" width="150px" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40"/> </div> <div class="addtocart"> Add to cart. </div> </div> Any help would be greatly appreciated. Nicole Hi, I have been developing a show/hide feature on my companies web site for some time. I have so much code as to where I am confused when I need to add another slide function. I have provided the URL below to the page where the code exists. http://www.pjm.com/markets-and-opera...assistant.aspx This is where I get lost with the huge amount of code that I have. If you take a look under the second slider named "Electricity Markets" there is another slider underneath named "Energy Market". I need to add three more sliders right underneath in the same format under "Energy Market" If anyone can assists with this that would be great. I should have organized the code a lot better, so now I get lost within the code now. BTW, the show/hide feature really does not display well in Firefox, please try in IE. Thanks! Hi, I have three tables and I want show one table at one time. At the bottom of one table I need to have "next" and "previous" links to go other two tables.Can you please help me. Thank You. http://www.suttonsilver.co.uk/client...on-calculator/ Please visit the above website, Click on a Injury Type (try Minor Head Injury) on the right hand side (the human figure) Then click on the Calculate button and you will see a "calculated" figure appear, if you then click on another injury type then calculate it again, another Div will show. If two "You could be entitled up..." DIVs pop up, the previous, initially calculated 'result' should be removed and replaced by the new 'result'. Can anyone help me do this? Also.. as a side note, does anyone have a solution for when clicking calculate, two divs show up... (i.e. a 'result' and a 'contact us form'). Cheers Chris SS I have a page where it has anchors going to different parts of the page and i have a list of links at the top to go to each anchor. when you click on the links to each part of the page it shows the "back to top, next, back" buttons. I have 7 different links, so i need to have this happen 7 times, I only want the "back to top, next, and back" buttons to be shown when the user clicks on the link to that specific anchor, or the next/back button to that anchor from another one. I have been doing this with the div hide/show javascript however it makes me have to change sooo much information to do this.. There has got to be an easier way.. It would take me forever to finish doing this to all of them, i need a better way to achieve this. There's too much code that its confusing. this is my current javascript: var ie = (document.all) ? true : false; function hideID(objID){ var element = (ie) ? document.all(objID) : document.getElementById(objID); element.style.display="none" } function showID(objID){ var element = (ie) ? document.all(objID) : document.getElementById(objID); element.style.display="block" } And this is just one of the links: <li><a onclick="showID('1939top'); showID('1939next');hideID('1940top'); hideID('1941top'); hideID('1942top'); hideID('1943top'); hideID('1944top'); hideID('1945top');" href="#1939">1939</a></li> And this is one of the back to top/next button codes: <a href="#1940"><span id="1939next" class="next-back" onclick="hideID('1939next'); hideID('1939top')"><div class="arrow-down"></div></span></span></a> <a href="#top"><span id="1939top" class="timeline-b2top" onclick="hideID('1939top')">Top</span></a><a name="1939" id="1939"></a> This code has always been a huge problem for me, not only does it take forever to change the effects and all, but it is VERY messy and I really need some help on how to code it lol. Thanks so much. Hi everyone, I'm new here, I actually found this site by searching for the code I have a question for. I'm trying to show/hide different drop down selectors, depending on what is chosen in another drop down selector. I modified a script (I found he http://www.codingforums.com/showthread.php?t=98406) in a way that I thought would work, but its not. Can anyone help me with what I'm doing wrong? Here is my page: http://www.leatherexpressonline.com/...er/testing.php Here is my javascript: http://pastie.org/3344253 And my drop downs: http://pastie.org/3344258 Also, I don't want the drop downs (ids: grade1000color, grade1500color, grade2000color, grade2500color, grade3000color, grade5000color) to be shown when the page is first loaded. Only when the correct option is chosen on the drop down. So I'm guessing I should add a display:none style to those drop downs, then have them shown on the javascript? Thanks so much for the help Hi Guys, I have a PHP loop region, which repeats all completed projects for each customer, then displays all jobsheets linked to those projects. I have a javascript show/hide function, which will only show the jobsheets when the project link is clicked. Without this javascript, the PHP loop works perfectly, but all the information is displayed. How can I use the show/hide function and still show all the jobsheets for completed projects? Code: function toggle2(id, link) { var e = document.getElementById(id); if (e.style.display == '') { e.style.display = 'none'; link.innerHTML = '<img src="../Images/plus.gif" border="0" >'; } else { e.style.display = ''; link.innerHTML = '<img src="../Images/minus.gif" border="0" >'; } } PHP Code: <table> <tr> <th>Project / Job</th> <th>Language</th> <th>Words (Net)</th> <th>Shipped</th> </tr> <?php $previousProject = ''; if ($totalRows_rsComplete_Cust > 0) { // Show if recordset not empty while ($row_rsComplete_Cust = mysql_fetch_assoc($rsComplete_Cust)) { if ($previousProject != $row_rsComplete_Cust['projid']) { // for every user, show the user name ?> <tr> <td colspan="4"><a href="#" onclick="toggle2('<?php echo $row_rsComplete_Cust['projid']; ?>', this)"><img src="../Images/plus.gif" border="0" /></a><?php echo $row_rsComplete_Cust['projid']; ?></td> </tr> <?php $previousProject = $row_rsComplete_Cust['projid']; } ?> <tr id="<?php echo $row_rsComplete_Cust['projid']; ?>" style="display:none"> <td><a href="jobsheet_details.php?id=<?php echo $row_rsComplete_Cust['jobid']; ?>&proj=<?php echo $row_rsComplete_Cust['projid']; ?>"><?php echo $row_rsComplete_Cust['jobname']; ?></a></td> <td>LANGUAGE</td> <td>WORD NET</td> <td>YES / NO</td> </tr> <?php }} // Show if recordset not empty ?> </table> Is there any way to make a link show if javascript is being used to hide it? This is the javascript code that is hiding the link: Code: <a href="javascript:void(0)" class="show-hide-link action-link"> As you can see the above warning will be only shown when there is an error while inserting the data into the login form. Now I have tried to achieve it by: Hiding the div say "warning". Use a javascript while submitting the form to check for input validation. If found any error, the hidden div "warning" will show above the form as shown as in the image. I have tried it in Edit fiddle - JSFiddle Ples help Hello, Could anyone help me? I'm looking for a script that remembers, re-sets, and can set to the previous state the show or hide behavior of a layer upon return to the page. I have an image gallery that's in 3 categories: wedding, bridal shower and save-the-dates. When viewing an image in the bridal shower or save-the date galleries and I press on the link I created titled "Back to Gallery" it does not return me back to the Bridal Shower or Save-the-dates gallery (whichever I'm in) it returns me to the main Invitations gallery page. So bascially I'm looking for a script that will write to a cookie what layers are shown and what are hidden so when you return it reads the cookie and displays the last layers you had showing before leaving the page. Code: <html> <title> random!!</title> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.min.js"></script> </head> <body> <div class="one" style="cursor: pointer;"> type1<br/><br/></div><div class="two" style="cursor: pointer;">type2<br/><br/></div><div class="three" style="cursor: pointer;">type3<br/><br/></div> <div class="oneone">atrdjgkhgfyfygfykfyfkygfvkgvkhgv</div><div class="twotwo">hgfihygohgohsgoihgolhgshgoshdgchchj</div><div class="threethree">siucgdiuhsbcohbscjbsidjcksjdnck</div> <script type="text/javascript"> $(document).ready(function() { $('div.twotwo').hide(); $('div.threethree').hide(); $('div.one').toggle(function() { $('div.twotwo').hide(); $('div.threethree').hide(); $('div.oneone').fadeIn('slow'); }, function() { return false; }); $('div.two').toggle(function() { $('div.oneone').hide(); $('div.threethree').hide(); $('div.twotwo').fadeIn('slow'); }, function() { return false; }); $('div.three').toggle(function() { $('div.twotwo').hide(); $('div.oneone').hide(); $('div.threethree').fadeIn('slow'); }, function() { return false; }); }); </script> </body> </html> The following code works perfectly when clicked once in each of the sub divisions(type1, type2, type3) for hide/show. But from the next time onwards we will have to click twice to initiate the hide/show. Can anyone suggest changes to make the code work as desired??.. P.S: sorry if i have made any stupid mistake.. i am quite new to this!! Hello I am new at Javascript. Please help me this: I have a form and a checkbox: Code: <input name="pass" type="password" class="textfield" /> <input type="checkbox" class="check"> Click here to show/hide password If I the checkbox is checked, it will show the password in the form, it means Code: <input name="pass" class="textfield" /> if not, the input form is: Code: <input name="pass" type="password" class="textfield" /> |