|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello,
Is it possible to add and delete visible objects (such as DIVs) with javascript after the page has load? I want to do this without reloading the page. In fact i've tried some examples, using the innerHTML inside a DIV and i've created some tables but i don't know how to delete them. Is innerHTML the right way to do this? And something else. If a delete method exists and i want to delete an object that contains other objects must i delete them first or i can delete only the parent object? Thanx. |
|
#2
|
||||
|
||||
|
Using CSS and a lil bit of JS, you can simply set the DIV to display:none;
|
|
#3
|
|||
|
|||
|
Add and Delete objects?
A few days ago i've asked if it is posible to create an MDI form with Javascript. The solution i found was to create an HTA that has two DIVS. The top DIV, that contains the menu (such as explorer) and the main DIV that it initially empty (grey). The whole think looks just like MS Excell with no window open.
What i wanna do is on operators request (according to the button that hits in the menu) to display in the main DIV the "forms", which in fact are draggable iframes. From that point i can think of two solutions. Either to create all the iframes from the beginning with visibility = hidden and change the visibility to visible when the operator hits the respective button, or to create - delete the iframes dynamically. What concerns me most is if the first solution has effect on the memory usage (I don't know really. Maybe my question is silly) because if it has i would prefer to create and delete an iframe every time the operator hits the menu. What do you think? By the way whats the difference between visibility:hidden and display:none? Thanx. Last edited by stumpy : May 13th, 2004 at 11:25 AM. Reason: Please type your posts normally - do note use unnecessary line-breaks |
|
#4
|
||||
|
||||
|
Display none completely removes the object from the page, whereas hidden keeps it in the page flow, taking up space (text will flow around it).
Your apps sounds overly complicated - such DHTML are usually a real pain to maintain as you struggle with various browser differences and bugs. Then there's the usability issue. |
|
#5
|
|||
|
|||
|
Add and delete objects
|
|
#6
|
|||
|
|||
|
Sorry about the null message. Wrong button!!
As i told in the previous (non null message) a form cinsists of a DIV that contains two tables. Table-1 represents the title bar of the form and Table-2 represents the body of the form. Inside Table-2 i have an iframe. Every time i hit the title bar, i bring that selected form in front of the others. The problem is that i wanna do the same by hitting in the body of the form but the iframe cannot capture the event onClick. The event is captured if place the onClick function in the <body> of the page that is the source of the iframe. Can i refer (from this page) to the DIV that contains the whole form, located in the main page? And by the way, which is the value of the display attribute that makes the form visible? |
|
#7
|
||||
|
||||
|
Please type your posts normally - do note use unnecessary line-breaks!
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Add and Delete Objects? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|