User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 401,513 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,336 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 3763 | Replies: 1
Reply
Join Date: Feb 2007
Location: St. Vincent and the Grenadines, Caribbean
Posts: 961
Reputation: scru is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 39
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Shark

javascript pop-up div

  #1  
Dec 9th, 2007
Hey. I'm looking for a solution that will create, fill and display a container in javascript directly beneath a specific element (no whitespace, margins w.e)
Half and a half meck a whole, and I donned it a hundrid purcent
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Posts: 75
Reputation: hielo is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 10
hielo hielo is offline Offline
Junior Poster in Training

Re: javascript pop-up div

  #2  
Dec 9th, 2007
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<script type="text/javascript"><!--
function insertAfter(parent, newNode, referenceNode)
{
	parent.insertBefore(newNode, referenceNode.nextSibling);
}
window.dynamicNodeCount=0;
function addElement()
{
	window.dynamicNodeCount++;
	var dad = document.getElementById('container');
	var elementAboveNew = document.getElementById('sib1');
	var newElement = document.createElement('div');
	newElement.innerHTML="Element " +window.dynamicNodeCount;
	insertAfter(dad,  newElement, elementAboveNew);
}
//--></script>
<div onclick="addElement();">Add Element</div>
<div id="container">
	<div id="sib1">a</div>
</div>
</body>
</html>
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 2:49 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC