<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
h1,h2,h3,p {
color: white;
text-align: center;
font-family: "Comic Sans MS", cursive, sans-serif;
}
#geenid {
position: absolute;
top: 60px;
left: 5px;
width: 555px;
height: 530px;
border: 1px solid #008800;
}
.spellen {
position: absolute;
top: 2px;
left: 2px;
width: 549px;
height: 524px;
overflow-y: auto;
border: 1px solid red;
}
/* class foei = een hidden shown div bij jquery dynamisch/statisch */
.foei {
position: relative;
top: 2px;
left: 2px;
width: 549px;
height: 524px;
overflow-y: auto;
border:1px solid yellow;
}
/* div aansturing jquery */
#spelknopjes {
position: absolute;
top: 600px;
left: 5px;
width: 555px;
height: 50px;
border: 1px solid #008800;
}
/* knopjes erbij */
.optie1 {
position: absolute;
top: 10px;
left: 55px;
font-size: 18px;
}
.optie2 {
position: absolute;
top: 10px;
left: 225px;
font-size: 18px;
}
.optie3 {
position: absolute;
top: 10px;
left: 410px;
font-size: 18px;
}
.optie1,.optie2,.optie3 {
font-family: "Comic Sans MS", cursive, sans-serif;
color: #006400;
background-color: #008800;
}
</style>
<title>Free 2 501</title>
<script src="/js/jquery-1.11.2.js"></script>
<script>
$(document).ready(function(){
//alert("Jquery Domain Object Model geladen");
function reload($elem, url, interval) {
(function doReload() {
$elem.load(url, function() {
setTimeout(doReload, interval);
});
})();
}
reload ($('.foei'), 'gamelist.phtml', 8000);
reload ($('#spelers'), 'playlist.phtml', 6000);
reload ($('#roomchat'),'/php/output501.php', 3000);
$('#mainform').submit(function(event) {
event.preventDefault();
$.ajax({
type: "POST",
url: "/php/input.php",
data: $('#mainform').serialize(),
success: function(data){
$('.msge').val('');
$('.msge').focus();
}
});
});
$('.optie1').click(function() {
$('.foei').hide();
$('.spellen').load('page1.phtml');
});
$('.optie2').click(function() {
$('.foei').hide();
$('.spellen').load('page2.phtml');
});
$('.optie3').click(function() {
$('.foei').hide();
$('.spellen').load('page3.phtml');
});
/* rest van de functies op page html */
});
</script>
</head>
<body>
<div id="geenid">
<div class="spellen"></div>
<div class="foei"></div>
</div>
<div id="spelknopjes">
<input type="button" class="optie1" value="Oefenen">
<input type="button" class="optie2" value="Overzicht">
<input type="button" class="optie3" value="Spelen">
</div>
<div id="spelers"></div>
<div id="roomchat"></div>
<form id="mainform" method="post" action="">
<input type="text" class="msge" name="message" maxlenght="100" size="34" autofocus autocomplete="off">
<input type="submit" class="onzin" name="submit" value="Beeldbuisvervuiling">
</form>
</body>
</html>
Tot zover werkt het verhaal. Maar in het onderstaande verhaal gaat het gruwelijk mis, de opgevraagde pagina verschijnt niet & het geheel loopt vast,,,,
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
<!--
$('.vaag5').click(function() {
//alert("functie vaag5 doet het");
$('.spellen').hide();
$('.foei').load('gamelist.phtml');
});
//-->
</script>
</head>
<body>
<div id="huh"><h3>Open spellen</h3></div>
<input type="button" class="vaag5" value="Stop">
</body>
</html>
Ik heb zo het idee dat ik hier ergens zwaar een flater bega, maar waar? Ik zie het even niet meer....