473,624 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing the content of a layer

Hi there,

wondered if someone could point me to an appropriate tutorial or offer
advice on the following problem?

I've got a web page which uses lots of divs to position the content of the
page and I'm using a nice javascript to alter the css of a table of links.
The thing is I don't want the table of links to point to an external site
but to calla function which will replace the content of a layer... perhaps
it's be better if I showed you the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<style type="text/css">
.cellButton{wid th:80px;backgro und-color:#A9A9A9;c olor:#000000;bo rder:#FFFFFF
1px solid;cursor:po inter;}
.cellButton2{wi dth:80px;backgr ound-color:#C8C8C8;c olor:#000000;bo rder:#FFFFFF
1px solid;cursor:po inter;}
</style>
<script language="Javas cript">
function overView(that){ that.className = 'cellButton2';}
function outView(that){t hat.className = 'cellButton';}
</script>
</head>
<body style="backgrou nd-color:#000000;" >
<div
style="position :absolute;left: 50%;top:50%;mar gin-top:-200px;margin-left:-300px;width:150 px;height:400px ;">
<a href="#">
<img style="width:15 0px;height:400p x;border-style:none;" alt="left"
src="left.gif"/>
</a>
</div>
<div
style="position :absolute;left: 50%;top:50%;mar gin-top:-190px;margin-left:-140px;width:150 px;height:400px ;">
<img style="width:28 0px;height:380p x;" alt="left" src="blank.gif"/>
</div>
<div style="position :absolute; left: 50%; top: 50%; margin-top: -200px;
margin-left: -150px; width: 300px; height: 400px;">
<img style="width:30 0px;height:400p x;" alt="" src="middle.gif "/>
</div>
<div style="position :absolute; left: 50%; top: 50%; margin-top: -200px;
margin-left: 150px; width: 150px; height: 400px;">
<a href="#">
<img style="width:15 0px;height:400p x;border-style:none;" alt="right"
src="right.gif"/>
</a>
</div>
<div
style="position :absolute;left: 50%;top:50%;mar gin-top:-170px;margin-left:-120px;width:240 px;">
<table
style="text-align:center;fo nt-family:monospac e;background-color:#C8C8C8;w idth:240px;"
border="1px" cellspacing="3p x" cellpadding="2p x">
<tbody>
<tr>
<td class="cellButt on" onmouseover="ov erView(this);"
onmouseout="out View(this);" onclick="locati on.href='#';">W hat</td>
<td class="cellButt on" onmouseover="ov erView(this);"
onmouseout="out View(this);" onclick="locati on.href='#';">W hy</td>
<td class="cellButt on" onmouseover="ov erView(this);"
onmouseout="out View(this);" onclick="locati on.href='#';">W hen</td>
</tr>
</tbody>
</table>
</div>
<div
style="position :absolute;left: 50%;top:50%;mar gin-top:-130px;margin-left:-250px;width:500 px;">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean non risus
in lorem convallis tempor. Ut viverra condimentum arcu. Donec posuere augue
id turpis. Donec lacinia fringilla pede. Maecenas eleifend. Ut mi velit,
mollis ut, luctus eget, condimentum ut, neque. Vivamus sodales pulvinar
magna. Ut dictum mi a risus. Maecenas ultricies erat luctus leo. Quisque
dolor. Nam dolor est, egestas ac, pellentesque eu, interdum sagittis, nulla.
Quisque non eros. Morbi malesuada commodo lacus. Pellentesque odio ante,
dapibus id, consequat nec, accumsan sit amet, lectus.
</p>
<p>
Etiam sit amet leo sed enim suscipit sodales. Donec ipsum. Suspendisse eget
velit eget nunc iaculis dapibus. Fusce libero. Sed eu lectus. In massa leo,
egestas nec, pulvinar tincidunt, cursus feugiat, magna. Praesent sagittis,
wisi eget dignissim tempus, wisi mauris vestibulum velit, quis convallis
velit sapien cursus nisl. Pellentesque blandit urna non neque. Cum sociis
natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Pellentesque lectus libero, convallis non, eleifend vel, condimentum sed,
felis.
</p>
</div>
</body>
</html>

So what I want to do is dynamically alter or replace the "Lorem ipsum"
paragraphs with some other arbitrary text when the "What", "Why" or "When"
buttons are pressed.

Any ideas or links will be greatly appreciated,

Cheers,

Dom
Jul 23 '05 #1
2 1725
"Dominic Myers" <an***********@ msn.com> wrote in message
news:2r******** *****@uni-berlin.de
Hi there,

wondered if someone could point me to an appropriate tutorial or offer
advice on the following problem?

I've got a web page which uses lots of divs to position the content
of the
page and I'm using a nice javascript to alter the css of a table of
links.
The thing is I don't want the table of links to point to an external
site
but to calla function which will replace the content of a layer...


Add to the Lorem Ipsum element
<div id="loremipsum " style=etc...

Then, somewhere in your javascript (this will wrap but is meant to be all on
one line.)

document.getEle mentById('lorem ipsum').innerHT ML = "<p>This is the new HTML
code.</p>"

Although javascript is available for just about every browser I've come
across it isn't always enabled so the above will fail on those browsers. It
will also fail if their browser (or User Agent) doesn't support
getElementById or innerHTML.
Make sure you've got a fall-back facility if you want to accommodate them.
eg: click here to view the information in plain text.
Jul 23 '05 #2
"PDannyD" <da*****@REMOVE THISBITscenicpl ace.freeserve.c o.uk> wrote in
message news:ci******** **@newsg2.svr.p ol.co.uk...
"Dominic Myers" <an***********@ msn.com> wrote in message
news:2r******** *****@uni-berlin.de
Hi there,

wondered if someone could point me to an appropriate tutorial or offer
advice on the following problem?

I've got a web page which uses lots of divs to position the content
of the
page and I'm using a nice javascript to alter the css of a table of
links.
The thing is I don't want the table of links to point to an external
site
but to calla function which will replace the content of a layer...


Add to the Lorem Ipsum element
<div id="loremipsum " style=etc...

Then, somewhere in your javascript (this will wrap but is meant to be all
on
one line.)

document.getEle mentById('lorem ipsum').innerHT ML = "<p>This is the new HTML
code.</p>"

Although javascript is available for just about every browser I've come
across it isn't always enabled so the above will fail on those browsers.
It
will also fail if their browser (or User Agent) doesn't support
getElementById or innerHTML.
Make sure you've got a fall-back facility if you want to accommodate them.
eg: click here to view the information in plain text.


You are indeed a true diamond, thank you very much!

Dom
Jul 23 '05 #3

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

Similar topics

3
9822
by: Catherine Lynn Smith | last post by:
I am creating a webpage with dhtml <DIV> layers and I want a link on one layer to modify the content on another but I seem to keep running into errors. Basically I create a layer in the middle of the screen that initially comes up with a gif image of a house: <!-- start "house" layer definition for center of screen --> <DIV id="house" style="position:absolute; left:140px; top:137px; width:510px; height:325px; z-index:2"><img...
14
2494
by: Brandon Hoppe | last post by:
I'm trying to change the src of an ilayer in the parent document from a link inside the ilayer. I'm not able to get it to work. All that happens is Netscape 4 crashes. This is for Netscape 4 only. For example, here is the main page: <html> <head> <script type="text/javascript">
6
3970
by: iwearwatches | last post by:
Group, What a root canal. Here is what I have: I have a page that has several layers that I will either show/hide based on a graphic/tab that the user clicks. (works perfectly)
7
1484
by: Brett Romero | last post by:
I'd like to copy a object1 into object2 so object2 can be manipulated. Object1 is coming form the middle layer into the UI layer. I'd like to rename a field in Object2 from "somethingID" to just "ID" and do this several times for a few middle layer objects. This will allow me to create generic<> lists and reference the field ID against many object2s that are similar to object1. The middle layer objects have ID fields with different...
0
1657
by: Rahul | last post by:
I have some resx files inside my Global Resources folder for the web and some other Resx files for the DataAccess layer project .For web project I am using Resx files for the Form control's (Label, textboxes etc..) naming purpose. My project would require constant changing of resx files after deployment. In asp.net 2.0 i published the web site and was able to see the Precompiled version. inspite of me making the Compile Action of Resx...
2
4760
by: l!m!t | last post by:
Hello, I hope somebody can help me I have been at this for hours. I am new to JavaScript. I need a script to show a layer of hidden content only when on a certain URL. I have searched and found nothing, is this possible to do ? Example: http://mydomain.com/index.php?1 = content = hidden http://mydomain.com/index.php?2 = content = show
7
3640
by: petethebloke | last post by:
Can anyone help? I have a client who has made a "dynamic interactive map" of our city using Dreamweaver. Each map file has hotspots that pop-up a div with a little image when the mouse goes over them. They also link to another file. I've converting the application to a PHP-AJAX system at http://www.ilex-urc-maps.com/testing.html but I can't get the dynamically altered hotspots to work. Any ideas? Please don't tell me that the client...
4
3318
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters the comments and clicks the save button then the date and the date will be stored in the mysql database. This is working fine. But my problem is when, after the user had made an entry the date in the calendar for which an entry has made should be...
0
8240
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8336
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
8482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7168
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
6111
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
5565
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();...
1
1791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1487
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.