Kod
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Przyklad 1-1</title>
<script type="text/javascript" src="jquery-1_2_3.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#wr3').hide("normal");
$('#wr4').hide("normal");
$('p').click(function(){
$('#wr1').hide("normal");
$('#wr2').show("normal");
});
$('p2').click(function(){
$('#wr2').hide("normal");
$('#wr3').show("normal");
$('#wr4').show("normal");
});
$('p3').click(function(){
$('#wr3').hide("normal");
$('#wr4').hide("normal");
$('#wr2').show("normal");
});
$('p4').click(function(){
$('#wr3').hide("normal");
$('#wr4').hide("normal");
});
});
</script>
</head>
<body>
<div
id="wr1"
style="width:100px;height:100px;
background-color:yellow;left:200x;top:40px;visibility:visible;"
>
</div>
<div
id="wr2"
style="width:100px;height:100px;
background-color:orange;left:200px;top:70px;visibility:visible; z-index:3;"
>
</div>
<div
id="wr3"
style="width:500px;height:500px;left:130px;top:100px;z-index:2;"
><img src="1.jpg" >
</div>
<div
id="wr4"
style="width:100%;height:100%;background-color:#000000; z-index:1;"
<p4 style=" color:#FF0000">zamknij</p4>
>
</div>
<p>cos</p><p2>cos</p2>
<p3>cos</p3>
</body>
</html>
robie tak. Są to zaczątki jakiejś tam prostej galeria którą chcę zrobić.
Otwieram ją na głownej stronie dzięki:
Kod
//object detection to return the correct object depending upon broswer type. Used by the getAXHA(); function.
function getNewHttpObject() {
var objType = false;
try {
objType = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
try {
objType = new ActiveXObject('Microsoft.XMLHTTP');
} catch(e) {
objType = new XMLHttpRequest();
}
}
return objType;
}
//Function used to update page content with new xhtml fragments by using a javascript object, the dom, and http.
function getAXAH(url,elementContainer){
document.getElementById(elementContainer).innerHTML = '
<div align="center"><blink class="redtxt">Loading...<\/blink></div>';
var theHttpRequest = getNewHttpObject();
theHttpRequest.onreadystatechange = function() {processAXAH(elementContainer);};
theHttpRequest.open("GET", url);
theHttpRequest.send(false);
function processAXAH(elementContainer){
if (theHttpRequest.readyState == 4) {
if (theHttpRequest.status == 200) {
document.getElementById(elementContainer).innerHTML = theHttpRequest.responseText;
} else {
document.getElementById(elementContainer).innerHTML="<p><span class='redtxt'>Error!<\/span> HTTP request return the following status message: " + theHttpRequest.statusText +"<\/p>";
}
}
}
strony otwieram dzieki
Kod
href="1.php" onclick="getAXAH('1.php','cos');getAXAH('info.html','cosi');return false;
tak jak pisałem wszstko otwieram w divach i nie chce chodzic:/