473,767 Members | 8,025 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

swapping divs -- when divs NOT positioned absolutely..

hi,

I need to swap divs.. I know how to do this very well when the divs are
positioned absolutely and thus they are "on top of" each other with
z-index, etc...

but now at work I have to do this w/divs that are not positioned
absolutely, they use two very large js files here for it (swapTabs.js
and prototype.js.. in case they sound familiar to anyone..) and every
time I have a hard time implementing it.. I was wondering if somebody
has a simpler formula to do this..

thank you very much...
Nov 14 '07 #1
1 1298
maya wrote:
hi,

I need to swap divs.. I know how to do this very well when the divs are
positioned absolutely and thus they are "on top of" each other with
z-index, etc...

but now at work I have to do this w/divs that are not positioned
absolutely, they use two very large js files here for it (swapTabs.js
and prototype.js.. in case they sound familiar to anyone..) and every
time I have a hard time implementing it.. I was wondering if somebody
has a simpler formula to do this..

thank you very much...

temp=div1.inner HTML;
div1.innerHTML= div2.innerHTML;
div2.innerHTML= temp;

//or use Elem.cloneNode( ), for a purer solution
Mick
Mick
Nov 14 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2931
by: Richard Barnet | last post by:
I have two DIVs with the same class in the same document. The CSS has the DIVs absolutely positioned, albeit with a percentage (bottom: 0%). Shouldn't the DIVs be in the exact same location instead of one above the other, since they're using the same class and hence the same position? -- Richard
16
2309
by: Pierre Jelenc | last post by:
I need to lay out a page with five main elements: A fixed div at the top containing a navigation bar, two side-by-side columns, a centered shopping cart at the bottom, and a full-window fixed div to provide a border. A test page is at http://www.marcvonem.com/discography.html The navigation bar and absolutely positioned side by side columns look fine (with a few cosmetic problems that will be dealt with later) but I cannot figure out...
12
6306
by: deko | last post by:
Is there any way to work around the blank space created by hidden divs? I'm trying to use a relatively postioned divs with show/hide behaviors to annotate an image. The divs show/hide onMouseOver/onMouseOut but leave a blank space on the page when hidden (the space where the divs would normally be). Is it possible to use z-indexing to put regular content where the hidden divs would be? When I try to do this, the layers don't unhide as...
4
2529
by: Vincent.Piattelli | last post by:
I working on a page that has two nested DIV elements. The child DIV is absolutely positioned within the parent DIV. The contents of the child DIV are dynamic, but no matter how large it get, I want the child to be rendered totally within the parent DIV. As things stand, as the child DIV grows, it overflows and sticks out. How can I style the parent so that it always is larger than the child?
2
4822
by: Jakub Åukomski | last post by:
hi. i've got a problem as follows, to which i can't find a solution to: i've got two divs, which are completely independent of each other (neither is a parent of child of another). they're positioned (either absolutely or relatively) in a way that they overlap each other. when i assign an onmousemove event to them, only one of them catches it. any capturing and/or bubbling is beeing performed by parents of the div that caught the...
22
2240
by: pamelafluente | last post by:
Dears, I'd like to know the cleanest solution for the following problem. I want to insert some CSS/htm after a long vertical column of DIVs absolutely positioned. Since this code is generated automatically by a streamwriter, I am looking for the cleanest and simplest solution possible. I would like:
2
2329
by: Ben Wall | last post by:
I have a page with six or seven absolutely positioned DIV blocks ... they all contain form elements .. text boxes, buttons, etc. and they all reside within a containing "master" DIV. What I need to do is overlay all of the DIVs with a "pop-up" DIV to get some additional input; so, on a button click I am setting the visibility and the top/left coordinates to bring it into position ... but what's happening is that three elements underneath...
2
3017
by: Mike | last post by:
Can someone please explain how onclick works with nested, absolutely positioned div containers? I would expect, when several divs are on top of one another, clicking on them would trigger an onclick event for each div. But it's not working that way. Take a look at the attached file. Clicking in the center of the "orange" div, I would think, would trigger an alert for all five of the divs. In fact, it doesn't even trigger one for the...
0
9407
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10014
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9960
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8840
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7384
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6656
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5280
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3931
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.