Create javascript popup window
-
Hello ! i'm new to web design and i have this problem : i'm creating a web site in dreamweaver cs3 (simple html).one of my pages have some article titles Title 1 Tilte 2 ........ i want to do this : When a user click on the title , to open a popup window without title bar that cointains one image , a description and a close button.But the image and the text should be variables to be used for all articles. Can someone give me a script in javascript for this situation ? Thank you in advance !
-
Hello ! i'm new to web design and i have this problem : i'm creating a web site in dreamweaver cs3 (simple html).one of my pages have some article titles Title 1 Tilte 2 ........ i want to do this : When a user click on the title , to open a popup window without title bar that cointains one image , a description and a close button.But the image and the text should be variables to be used for all articles. Can someone give me a script in javascript for this situation ? Thank you in advance !
Just without doing window.open for which you cant hide title bar, use a floating div to create the popup.
var x = document.createElement('div');
x.style.position = 'absolute';
x.style.top='100px';
x.style.left = '300px';
document.appendChild(x);Set appropriate content and also review the position according to your requirement. :cool::cool:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
-
Just without doing window.open for which you cant hide title bar, use a floating div to create the popup.
var x = document.createElement('div');
x.style.position = 'absolute';
x.style.top='100px';
x.style.left = '300px';
document.appendChild(x);Set appropriate content and also review the position according to your requirement. :cool::cool:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
thank you but i want 2 object inside popup to be variables 1 image and 1 text description , so when i click the first article the popup should show the first image and the first description , when i click the second article the popup should show the second image and description .... . is possible to do that ? thank you.
-
thank you but i want 2 object inside popup to be variables 1 image and 1 text description , so when i click the first article the popup should show the first image and the first description , when i click the second article the popup should show the second image and description .... . is possible to do that ? thank you.
Create an img element and appendChild to the Div. Or just assign the innerHTML to the div you have created inside the popup. You can change innerHTML also when required. :thumbsup:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.