login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Probleem met frame, tabellen, div

Offline Kaboutermans - 04/02/2009 22:06
Avatar van KaboutermansNieuw lid Ik heb nu ongeveer anderhalf jaar een site en ik probeer de site nu een beetje te verfraaien.
Momenteel werk ik met 2 frames in het linker frame staat het menu wanneer daar een pagina wordt aan geklikt wordt deze geopend in het rechter frame. Dat zelfde idee wil ik nu eigenlijk vast houden maar ik wil ook een header en een footer toevoegen.
In de header wil ik gewoon een afbeelding plaatsen met de titel van de site. In de footer wil ik een muziek speler laten spelen. Deze wil ik dus niet opnieuw laten laden wanneer iemand naar de volgende pagina gaat.

De pagina's die in het menu worden aangeklikt moeten dus worden geladen in de main content zonder dat de rest wordt vernieuwd. Is dit mogelijk en zo ja hoe?

Ik hoop dat alles duidelijk is, anders wil ik het nog een keer duidelijker proberen uit te leggen.
Alvast bedankt,

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  3. <title>Untitled Document</title>
  4. <style type="text/css">
  5. <!--
  6. body {
  7. font: 100% Verdana, Arial, Helvetica, sans-serif;
  8. background: #666666;
  9. margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
  10. padding: 0;
  11. text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
  12. color: #000000;
  13. }
  14. .twoColLiqLtHdr #container {
  15. width: 80%; /* this will create a container 80% of the browser width */
  16. background: #FFFFFF;
  17. margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
  18. border: 1px solid #000000;
  19. text-align: left; /* this overrides the text-align: center on the body element. */
  20. }
  21. .twoColLiqLtHdr #header {
  22. background: #DDDDDD;
  23. padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
  24. }
  25. .twoColLiqLtHdr #header h1 {
  26. margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
  27. padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
  28. }
  29.  
  30. /* Tips for sidebar1:
  31. 1. since we are working in percentages, it's best not to use padding on the sidebar. It will be added to the width for standards compliant browsers creating an unknown actual width.
  32. 2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColLiqLtHdr #sidebar1 p" rule.
  33. 3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
  34. */
  35. .twoColLiqLtHdr #sidebar1 {
  36. float: left;
  37. width: 24%; /* since this element is floated, a width must be given */
  38. background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
  39. padding: 15px 0; /* top and bottom padding create visual space within this div */
  40. }
  41. .twoColLiqLtHdr #sidebar1 h3, .twoColLiqLtHdr #sidebar1 p {
  42. margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
  43. margin-right: 10px;
  44. }
  45.  
  46. /* Tips for mainContent:
  47. 1. the space between the mainContent and sidebar1 is created with the left margin on the mainContent div. No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
  48. 2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 430px or smaller (this includes images).
  49. 3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs.
  50. */
  51. .twoColLiqLtHdr #mainContent {
  52. margin: 0 20px 0 26%; /* the right margin can be given in percentages or pixels. It creates the space down the right side of the page. */
  53. }
  54. .twoColLiqLtHdr #footer {
  55. padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
  56. background:#DDDDDD;
  57. }
  58. .twoColLiqLtHdr #footer p {
  59. margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
  60. padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
  61. }
  62.  
  63. /* Miscellaneous classes for reuse */
  64. .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
  65. float: right;
  66. margin-left: 8px;
  67. }
  68. .fltlft { /* this class can be used to float an element left in your page */
  69. float: left;
  70. margin-right: 8px;
  71. }
  72. .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
  73. clear:both;
  74. height:0;
  75. font-size: 1px;
  76. line-height: 0px;
  77. }
  78. -->
  79. </style><!--[if IE]>
  80. <style type="text/css">
  81. /* place css fixes for all versions of IE in this conditional comment */
  82. .twoColLiqLtHdr #sidebar1 { padding-top: 30px; }
  83. .twoColLiqLtHdr #mainContent { zoom: 1; padding-top: 15px; }
  84. /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
  85. </style>
  86. <![endif]--></head>
  87.  
  88. <body class="twoColLiqLtHdr">
  89.  
  90. <div id="container">
  91. <div id="header">
  92. <h1>Dit mag het zelfde blijven</h1>
  93. <!-- end #header --></div>
  94. <div id="sidebar1">
  95. <h3>Menu</h3>
  96. <p>Hier moet een menu komen met Javascript. Ik heb de pagina al als htm bestand.</p>
  97. <!-- end #sidebar1 --></div>
  98. <div id="mainContent">
  99. <h1> Hier moet de eigenlijke pagina vanuit het menu worden geladen zonder de rest opnieuw te laden.
  100. <!-- end #mainContent --></div>
  101. <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
  102. <div id="footer">
  103. <p>Hier komt een muziek speler die niet opnieuw moet worden geladen.</p>
  104. <!-- end #footer --></div>
  105. <!-- end #container --></div>
  106. </body>
  107. </html>


2 antwoorden

Gesponsorde links
Offline Raze - 05/02/2009 11:34 (laatste wijziging 05/02/2009 16:19)
Avatar van Raze PHP beginner Misschien is een tip div's...

ik heb ook een tijd met frames websites gemaakt, totdat ik de div ontdekte  

EDIT: ok ik zag idd niet dat je div's gebruikte sorry  

in dat geval misschien iframes?
Offline Tuinstoel - 05/02/2009 11:37
Avatar van Tuinstoel PHP expert Raze kijk dan naar z'n code. Hij gebruikt div's zo te zien alleen hij wil niet hebben dat zijn gehele pagina refresht begrijp ik?
Is gewoon een frame er boven en er onder absoluut geen optie? Anders zou je AJAX-techniek moeten overwegen. Dan klik je ergens op en zou je de content div kunnen vernieuwen zonder dat de rest vernieuwt.
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.175s