Вот решил на чистом javascript:
<html>
<head>
<title>linksShowBlocks.html</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
.popDiv {
border: 1px solid #000;
width: 200px;
height: 100px;
}
</style>
</head>
<body>
<a id="link1">Ссылка1</a>
<a id="link2">Ссылка2</a>
<script>
var li1=document.getElementById("link1");
var li2=document.getElementById("link2");
li1.onclick=li2.onclick=function() {
if(!this.state) {
this.state=true;
var div=document.createElement("DIV");
div.innerHTML=this.innerHTML;
div.className="popDiv";
this.div=div;
document.body.appendChild(div);
}
else {
this.state=false;
document.body.removeChild(this.div);
}
}
</script>
</body>
</html>
|