HTML - Parent/child Issue With <div>
Similar Tutorialscan you detect if a page is a child? (in an iframe) if (page is a child) { parent.remoteClick('myButton'); } else { } thanks. or the opposite i suppose... if (page is a parent) { } else { parent.remoteClick('myButton'); } i have 2 frames in my parent frame say 1.htm ie left frame and 2.htm ie right frame now this 1.htm is quite a long frame and has a scrollbar and 2.htm is a short one i dont the scroll bar beside my frame 1 but want it to be for my entire parent window ie i wont to scroll both my left and right frames together how do i do that Hi, I have a java script function like this to open one child window form main window. Its working properly. function billingMain() { top.consoleRef=window.open('#{facesContext.externa lContext.requestContextPath}/main/billing/billingMain.jsf','window1', 'width=950,height=400' +',menubar=0' +',toolbar=0' +',status=0' +',scrollbars=1' +',resizable=0' +',location=0') top.consoleRef.document.close() } But when my child window opened, i want to open another child window from previous child window. and here is the script follows for this, function UB92Main() { top.consoleRef=window.open('#{facesContext.externa lContext.requestContextPath}/main/billing/claimInformation.jsf','UB92', 'width=450,height=250' +',menubar=0' +',toolbar=0' +',status=0' +',scrollbars=1' +',resizable=0' +',location=0') top.consoleRef.document.close() } here the second child window is not opening. How to resolve this. Thanks, Vinutha. Hi everyone, I've got a page that's being generated dynamically that I need to set the last <li> in each list to a different style. As it's being generated server-side, I can't predict how many <li> items there will be or assign a .last class to the last <li> in each list manually. Now I'm not sure whether this needs a CSS/Javascript/xmls solution, so any pointers would be most appreciated. In FF & Opera (I think) I could just use the last-child psuedo class and the world would be fine, however it doesn't work in IE6... Does anyone know if anyone's produced an IE javascript fix for this that I can just apply? Or is there another nifty hack? Any pointers would be most appreciated! HTML Code: <head> <script type="text/javascript"> function addGroup() { x=document.getElementById("group").getElementsByTagName("p"); groups=document.getElementById("groupName"); var j=0,i=0; if (groups.value=="") { alert('must create one group'); } for (i=0;i<x.length;i++) { if (x[i].innerHTML == groups.value) { alert('the group name is already created'); j==1; } } if (j==0) { x.appendChild(groups); } } </script> </head> <body> <div id="group"> <p>Group03</p> </div> <p><input type="text" id="groupName" size="84" maxlength="84" value=""/></p> <p><input type="button" value="create" onclick="addGroup()" /></p> </body> I am trying to do simple HTML that read a group from a input box and append the new group to the group section under id="group" but the appendChild does not seems to work, any clue on how to make it works? Hey, I'm trying to make a child div become the height of the child div the height of the parents. The parent's height is calculated by the browser depending on the rows of text inside the div. But when I try it, the child div only resizes to the number of rows inside the child. Here is a better example: http://nitronet.dnip.net:8080/Nitro%...ay/index.xhtml Help? --ness I'm trying to set up html links in a parent window that update content in the same child window(rather than opening successive new windows with each click). Having the same target name in the anchor tag looks to be the easiest way to do this but it's not working in conjunction with a servlet mapping. This works: Code: <a href="test.html" TARGET="targetWindow">Click Here</a><BR> This doesn't work. This link will open a new window every time it's clicked Code: <a href="someURLmapping" TARGET="targetWindow">Click Here</a><BR> What is it about the servlet URL mapping that causes the links to not return to the child window? Is there another way to solve this issue? Thanks! Shawn I have main window and child window opened by child = window.open(adr, name, "height=200, width=600,resizable=1"); Both pages have <title>title</title> But whereas main widow has in title bar "title - Microsoft Internet Explorer" ,the child window has "http://<ip address> - title - Microsoft Internet Explorer" Why that difference? I want the ip address in child window to disappear, but don't know how. It does the same in IE6 and Mozilla. Thanks. Sorry if my title sounds a little strange lol. I've been designing a layout for a new site of mine, and I decided to (attempt to) comply with XHTML guidelines, and use DIV's rather tables. I've got a container div, which contains a couple more divs, such as for the header, left navigation, content etc. Problem is, the left navigation bar is going to be quite long as I plan to include a skyscraper ad underneath the navigation bar, if possible. I've put the left navigation bar inside the content div (as you can see in the pictures coming up)...so when there's not much content, because the left nav will be so tall the left nav extends beyond the content box - I was hoping to find a way to make the content div stretch to accomodate this. It strangely works as desired in IE7 (http://img515.imageshack.us/img515/7070/ie7ix9.jpg), but in Firefox it doesn't ( http://img180.imageshack.us/img180/2480/ffow1.jpg) Is there any way to make the content div expand with the left nav div? Thanks very much Source code: Code: <html> <head> <style type="text/css"> body { background-color: #272727; color: #FFFFFF; font-family: Verdana, Sans-Serif; font-size: 10px; margin: 0px; padding: 0px; text-align: center; } h1 { color: #adc203; font-size: 14px; text-align: center; } a:link { color: #adc203; } a:hover { color: #444444; } a:visited { color: #bbc758; } .container { width: 775px; background-color: #1a1a1a; margin-left: auto; margin-right: auto; } .header { width: 775px; height: 141px; } .logo { width: 611px; height: 141px; float: left; } .login { background-image: url(images/login.png); width: 164px; height: 141px; float: right; } .content { background-image: url(images/content.png); width: 775 px; background-repeat: repeat-y; text-align: left; } .innercontent { padding-left: 25px; padding-right: 25px; } .linkbox { margin-top: 5px; margin-right: 15px; width: 160px; background-color: #151515; float: left; font-size: 14px; } .linkbox div { padding: 5px; padding-top: 0px; } .linkbox h1 { color: #adc203; font-size: 14px; text-align: center; } .linkbox a:link { color: #FFFFFF; text-decoration: none; display: block; padding-left: 5px; } .linkbox a:hover { color: #FFFFFF; background-color: #abc203; padding-left: 5px; } .linkbox a:visited { color: #bbc758; padding-left: 5px; text-decoration: none; } .googlebox { float: left; clear: left; margin-top: 10px; margin-right: 15px; width: 160px; height: 600px; background-color: #161616; } </style> </head> <body> <div class="container"> <div class="header"> <div class="logo"><img src="images/logo.jpg" alt="DesignersVAULT" /></div> <div class="login">Test</div> </div> <div class="content"> <div class="innercontent"> <div class="linkbox"> <div> <h1><span style="color: #444444;">designers</span>vault</h1> <a href="link.html">Home</a> <a href="link.html">Contact Us</a> <a href="link.html">Suggest A Feature</a> <h1>tutorials</h1> <a href="photoshop.html">Photoshop</a> <a href="photoshop.html">XHTML</a> <a href="photoshop.html">CSS</a> <a href="photoshop.html">PHP/MySQL</a> <a href="photoshop.html">General Design</a> <h1>layouts</h1> <a href="photoshop.html">Free</a> <a href="photoshop.html">Premium</a> <a href="photoshop.html">Designed For You</a> </div> </div> <div class="googlebox"> </div> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris id ligula. Nam nec nunc sed nunc malesuada pretium. Curabitur at augue. Sed pede est, ultrices sit amet, semper quis, venenatis a, turpis. Nam fermentum neque in tortor. Proin tortor. Suspendisse posuere. Duis gravida nulla a lectus. Vestibulum porttitor aliquet lorem. Morbi tortor. Fusce elementum. Quisque scelerisque mauris vitae mi. Ut et orci id augue sollicitudin auctor. Proin urna. In nibh purus, gravida vel, vehicula nec, vulputate eu, quam. Donec quis dolor. Aenean sed arcu at lectus imperdiet sodales. Pellentesque egestas. Praesent id augue. Maecenas nisl. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Maecenas sed risus. Cras non ipsum. Duis mollis auctor nulla. Integer ornare orci a lorem. Praesent eleifend. Sed ac ligula et est faucibus rutrum. Aliquam felis. Sed elementum tempus erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam lacinia massa et augue. Integer vel augue id arcu viverra tincidunt. In hac habitasse platea dictumst. Nunc sodales ante et nunc. Vivamus posuere. Morbi ipsum. Aliquam fermentum sollicitudin felis. Sed varius dolor ut leo. Duis consectetuer urna id eros. Suspendisse ut ante. Maecenas quis diam. Phasellus fringilla velit. Praesent interdum rhoncus tortor. Fusce sollicitudin. Mauris a nibh nec mauris tincidunt rutrum. Mauris malesuada, tellus in accumsan dignissim, quam ligula tempor enim, interdum feugiat nisi risus in elit. Vestibulum sapien. Aliquam erat volutpat. Sed id sem ac justo laoreet elementum. Aliquam urna. Curabitur felis. Nam sed purus non lacus hendrerit aliquet. Sed a urna a metus luctus venenatis. Aenean purus ante, rutrum eu, hendrerit vitae, tincidunt quis, nisi. Duis pellentesque, justo at malesuada vestibulum, urna dolor cursus mauris, eget luctus eros massa et purus. Nam magna. Ut aliquam sodales purus. Vestibulum ut augue sit amet est elementum lacinia. Vestibulum tempor est a magna. Nulla luctus pellentesque diam. Aenean elementum turpis et tortor. Maecenas feugiat rutrum erat. Nullam ac elit. Donec auctor gravida ligula. Vivamus posuere dui a arcu. Suspendisse potenti. Morbi dolor augue, sagittis quis, accumsan quis, aliquam molestie, enim. Phasellus faucibus odio id neque. Curabitur iaculis ligula ac purus. In quis ante ac ante bibendum vestibulum. Etiam a lacus id est rhoncus ultrices. Morbi vitae magna et erat porttitor luctus. Aliquam erat volutpat. Curabitur sit amet sapien sit amet nulla faucibus accumsan. Nam ornare, mauris vel dignissim commodo, risus dolor scelerisque purus, viverra porta lectus tortor quis mauris. Etiam at turpis eget nisi cursus pulvinar. Suspendisse ultrices. Vivamus blandit scelerisque odio. Curabitur fringilla eleifend nisi. Quisque vel purus vitae turpis auctor iaculis. Maecenas est pede, malesuada vel, adipiscing semper, adipiscing quis, tortor. Donec vitae nisl vel dolor lacinia sodales. Sed tempor. Nullam congue condimentum ante. Suspendisse blandit, nulla quis condimentum varius, tellus est posuere augue, a suscipit sem nulla dictum orci. Nunc sagittis turpis at ante. Donec sit amet massa et nulla lacinia mollis. Donec blandit, justo et faucibus tincidunt, pede massa eleifend tellus, id tristique mi nulla a nibh. Quisque commodo lacus nec diam. Aliquam suscipit. Aliquam a ante. Integer tincidunt purus vel pede. In hac habitasse platea dictumst. Etiam at nisi quis velit scelerisque ultricies. Sed dui lorem, fringilla sit amet, ultrices blandit, auctor a, magna. </div> </div> </div> </body> </html> Hi, I have a table in which some entries open a new window with the required information. when a new window is opened, my parent page scrolls to the top, and again I have to search for the row where I had been previously, What property should I set as to avoid this? Please reply.. I have a parent div=body, and four child div's=sidebar (dark gray), spacer1, content (white), and spacer2. Those are not the backgrounds of the individual div's. I'm using a faux columns method of taking the parent's bg and y-repeating it. You can see the problem below. This works in IE6, but not in Firefox. This would lead me to assume there's a problem in my coding, but the way FF is displaying it...it's like firefox is placing it in a different column just to peeve me off. In IE6 (perfect): In FF (looks like script was placed in spacer1 column--padding:10 for content div) I noticed it repeated correctly for the first div, but it's like it started over with the spacer1 div and doesn't even repeat down: Here is the code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>DCS College Football Ratings and College Football News</title> <link rel="stylesheet" href="css/jd.gallery.css" type="text/css" media="screen" /> <script src="scripts/mootools.v1.11.js" type="text/javascript"></script> <script src="scripts/jd.gallery.js" type="text/javascript"></script> </head> <body background="images/bg.png"> <div id="container" style=" width:785px; background:inherit; height:auto; margin:0 auto;"> <div id="header" style="background:url('images/layout_01.png'); width:785px; height:121px;"></div> <div id="navbar" style="background:url('images/layout_02.png'); width:758px; height:26px; padding-top:9px; padding-left:27px; clear:both;"> <font color="#cecece" face="Verdana" size="2"><b>»Home »The D-Report »DCS Ratings »Custom Helmets »About the DCS</b></font></div> <div id="subheader" style="background:url('images/layout_03.png'); width:785px; height:49px; clear:both;"></div> <div id="body" style="background:url('images/contentbg.png'); width:785px; height:auto; float:left;"> <div id="sidebar" style="background:inherit; width:260px; padding:10px; height:auto; float:left; "> <font face="verdana" color="#cecece" size="3"><b>The D-Report</b></font><br><font face="verdana" color="white" size="1"><b>Info about the most current DCS news article here. More typing going on to fill up some more space, ya know what I mean?</b></font><br><br><br><br><font face="verdana" color="#cecece" size="3"><b>DCS Ratings</b></font><br><font face="verdana" color="white" size="1"><b>Info about the most current DCS ratings update here. More typing going on to fill up some more space, ya know what I mean?</b></font><br><br><br><br><font face="verdana" color="#cecece" size="3"><b>Custom Helmets</b></font><br><font face="verdana" color="white" size="1"><b>Info about the most current custom helmet here. More typing going on to fill up some more space, ya know what I mean?</b></font></div> <div id="spacer1" style="background:inherit; width:17px; height:auto; float:left; "></div> <div id="content" style="background:inherit; width:440px; padding:10px; height:auto; float:left;"> <div id="myGallery" style="width: 438px !important; height: 250px !important;" ><script type="text/javascript"> function startGallery() { var myGallery = new gallery($('myGallery'), { timed: true, showArrows: false, showCarousel: false }); } window.addEvent('domready', startGallery); </script> <div class="imageElement"> <h3>Item 1 Title</h3> <p>Item 1 Description</p> <a href="mypage1.html" title="open image" class="open"></a> <img src="images/brugges2006/1.jpg" class="full" /> <img src="images/brugges2006/1-mini.jpg" class="thumbnail" /> </div> <div class="imageElement"> <h3>Item 2 Title</h3> <p>Item 2 Description</p> <a href="mypage2.html" title="open image" class="open"></a> <img src="images/brugges2006/2.jpg" class="full" /> <img src="images/brugges2006/2-mini.jpg" class="thumbnail" /> </div> </div></div> <div id="spacer2" style="background:inherit; width:28px; height:auto; float:left; "></div> </div> <div id="footer" style="background:black; width:785px; height:86px; clear:both"> <div id="contentfooter" style="background:url('images/layout_10.png'); width:460px; height:52px; margin-left:297px;"></div> </div> </div> </body> </html> Could it have something to do with the image scripting? hiii all, i am making 2 html pages. one is parent window and another is child window but i want, when i click on a link of child window , parent page will load but with diff frame on parent page i am able to reload the parent pag but the same form will appear so how can i load diff form when parent page is reload?? please mention code for both child and parent page and i am using html e\with java script please reply thanks I have semi-protected my website (nothing important) by having a frameset, and a login page for the first visible page. However, if I'm somewhere in the website and I refresh the page, the browser refreshes the entire frameset and I'm back to the original login page (which is flash). Is there any way to redirect the refresh, so that once I'm in the website, only the frame with content refreshes? The frameset is *,100%, so I only want the 100% to refresh, see... Also, I'm working with XHTML for the first time, and I don't know much about it. Can anyone validate/verify this source code? Thanks! This is the entire frameset code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- InstanceBegin template="/Templates/template2.dwt" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content= "text/html; charset=us-ascii" /> <title>xxx</title> </head> <frameset rows="*,100%"> <frame name="hidden" src="xxx.html" scrolling="no" frameborder="0" /> <frame name="visible" src="password.html" scrolling="auto" frameborder="0" /> <noframes><body /></noframes> </frameset> </html> The following code works fine in any version of Internet Explorer, but sadly not Firefox. SetPrompt is just a javascript method from my frame called fraMap that sets the text of a textbox. Can someone please tell me how to accomplish this in Firefox? I have tried to search the forums and used examples but nothing I have found has worked, thanks for any advice! Code: parent.fraMap.SetPrompt("Click Two Diagonal Points To Set Zoom Area"); I'm re-styling a website I've build for people at work. It contains a header (or title) DIV, a menu DIV and a so-called InfoCell DIV (which is nothing more then a DIV containing an iframe that shows the requested page from the menu). The problem is that the iframe always resizes to a minimum size and can not show the requested page entirely. (see here) I want the iframe to resize to the InfoCell DIV which will in turn resize to the browser's viewing window (like the rest of the page does). (remark: the office uses IE6 atm cause upgrading to 8 or using a different browser appears to be a problem for some web-applications used at the office) I've tried JavaScripts, I've tryed adjusting CSS settings, but I can't get the iframe to resize itself to the size of its parent DIV. I can make the iframe fit the full size of the InfoCell DIV when I use fixed width and height in the css. But this cancels the ability of resizing the browser window to the user's liking. The parent DIV does resize when I resize the browser window, as do the menu and title DIVs. The XHTML code: Code: <div class="title"> Servicedesk ICT Web Application Portal </div> <div class="menu"> ...code for menu items... </div ... <div class="infocell"> <iframe src="http://rsdweb.info.uwv.nl/servicedeskrsdweb/" name="info" id="infoframe" /> </div> the CSS code: Code: div.infocell { margin:4px; padding:2px; border:1px solid #e0e0e0; background:#c3c3c3; overflow:auto; } div.infocell iframe { margin:0; border:none; } Any tips/tricks on how to make the iframe always fit 100% in its parent DIV? (so resizing the browser window will resize the DIV and the Iframe in turn). thnx EDIT: Sorry, found the answer. No need to give me a solution. I've decided to create a photo album in HTML (and Flash and CSS) using a nifty little Flash thing called SimpleViewer. However, I want multiple galleries, each within their own folder within the main photo gallery parent folder. How can I link something from one HTML file in a gallery's folder to the parent folder and then into another HTML file in another gallery's folder? Or if there's a way, directly to the other gallery's HTML file? Note I'm keeping this gallery offline for now, I'm only using it to show family and friends and for myself as it's much less cumbersome than using software or the standard Windows XP folder structure. Sorry if this is confusing, please say so if it is. Thanks in advance for all help, it's really appreciated. Hello dear forum, This is a big one, and I need some serious help. Have been trying to figure this one by myself, but I just couldn't, so I hope that you can help! Let me explain: I have a page with a Header/Menu which is a simple table, and an Iframe (frmMain) with some content. Here's what I need to do: onLoad & onResize the frmMain should get re-sized The main scrollbar on the page/window should scroll the frmMain content Re-size: The header should always stay 45px in height, but the frmMain should re-size to fill out the page vertically. Scroll: The scroll-bar on the main window/page should scroll the content of the frmMain of necessary. I have made an illustration to try explain my problem: Hello, How can I make my parent-scrollbar scroll the iFrame? I have a page with an Iframe in it, and I don't want the iFrame to have a scrollbar, but I want to be able to scroll the iFrame using the scrollbar of the window/parent! HOW? I have already set the HTML overflow-y to scroll, so the scrollbar is always showing. Now I only need it to control the iFrame. Please help! Hi, I have a div element, that will contain various debug/warning messages from Javascript. If I set it's height to 100%, so to fill the parent element, it overlaps the parent element. How can I automatically set the height, without manually setting the height in pixels? Many thanks for any suggestions. Regards Aaron HTML Code: <div style="border-style: solid; border-width: 3px; margin: 0px; padding: 0px; z-index: 1000; position: fixed; top: 252px; left: 582px; width: 494px; height: 202px; background-color: white; display: block;"> <h1 style="width: 100%; height: 20px; font-size: 12px; display: block; border-bottom-width: 2px; border-bottom-style: solid; vertical-align: middle;"><img src="https://127.0.0.1/beer2/i/clear.png" style="cursor: pointer;" alt="clear"/><img src="https://127.0.0.1/beer2/i/min.png" style="cursor: pointer;" alt="Minimise"/> Debug Window</h1> <div style="overflow: scroll; width: 100%; height: 100%; font-size: 12px; position: static;"> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> </div> </div> ok.. well.. im making a control panel.. that updates the parent window... this is the code in the parent window to pop up the child: <img src="g2cpanel.jpg" onClick="window.open ('cpanel.html', 'newWin', 'width=255, height=255')"> and this is the whole page of my child window: <html> <head> <title>boyo productions::control panel</title> <style type="text/css"> body {background-color: black; text-color: yellow; } .maintitle {background-color: yellow; text-align: center; }</style> <script language="JavaScript"> function updateParent(newURL){ opener.document.location = new URL } </script> </head> <body><center> <img src="cpanel.jpg"><br> <div class="maintitle">welcome to the control panel!</div> <a href="javascript: updateParent('index.html')">**home**</a><br><br> <a href="javascript: updateParent('codes.html')">**get the codes!**</a><br><br> <a href="javascript: updateParent('forum.html')">**forum(coming soon)**</a><br><br> <div class="maintitle">© boyo productions 2007-2008</div> </body> </html> my problem is that i can get the control panel to pop up once the image is clicked on, but, in that child window of a control panel, the links wont update the parent window.. whats wrong with my code? plz help me.. ty all |