473,388 Members | 1,524 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Replace Heading in Table

I have Javascript called in HTML which runs a slide show. One thing that the
HTML does is it has a "heading" just over the picture that never changes.
I'd like to be able to have this heading be replaced with some other value
to match the slide.

The slides are run with code like this; this is just part of it:

<select name="slide" onChange="change();">
<option value="photos\5857250r10198.jpg" selected>Ukranian students welcome
us to TCI
<option value="photos\5857729-r104521.jpg" selected>Tucson team with
translators, at KCC
</select>
The function that runs the slide is ap(this.value) and the value in "option
value" is what appears in "this.value."

Notice the descriptions to the right of each picture? I'd like to have the
heading be replaced with whatever that description is. Currently the
DROP-DOWN BOX does, but I'd like the heading to also--to give the photo a
large & obvious heading you can't miss.

Tips?

LRH
Jul 23 '05 #1
1 1969
Larry R Harrison Jr wrote:
[...]
<select name="slide" onChange="change();">
<option value="photos\5857250r10198.jpg" selected>Ukranian students
welcome us to TCI
<option value="photos\5857729-r104521.jpg" selected>Tucson team with
translators, at KCC
</select>
The function that runs the slide is ap(this.value) and the value in
"option value" is what appears in "this.value."

Notice the descriptions to the right of each picture? I'd like to have the
heading be replaced with whatever that description is. Currently the
DROP-DOWN BOX does, but I'd like the heading to also--to give the photo a
large & obvious heading you can't miss.


Assuming that the image and heading is specified as

<div id="descr" style="position:relative; left:0; top:0">&nbsp;</div>
<img src="..." alt="..." ...>

you could write

if (document.getElementById)
{
this.getElemById = function getElemById(id)
{
return document.getElementById(id);
}
}
else if (document.all)
{
this.getElemById = function getElemById(id)
{
return document.all(id);
}
}
else if (document.layers)
{
this.getElemById = function getElemById(id)
{
return document.layers[id];
}
}
else
{
this.getElemById = function getElemById()
{
return null;
}
}

function ap(v)
{
// ...
var descr = getElemById("descr");
if (descr)
{
if (descr.firstChild) descr.firstChild.nodeValue = v; // DOM 2+
else if (descr.innerHTML) descr.innerHTML = v; // DOM 0
else if (descr.innerText) descr.innerText = v; // IE DOM
else if (descr.document) // NN4 DOM
{
descr = descr.document;
descr.open();
descr.write(v);
descr.close();
}
}
// ...
}
HTH

PointedEars

P.S.
Does NetIdentity, 350 South Center Street, Ste. 500 Reno,
NV 89501, know that you are abusing their domain?

<http://www.interhack.net/pubs/munging-harmful/>
Jul 23 '05 #2

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

Similar topics

1
by: andreas kirschner | last post by:
hello regexp developers, how can i replace text outside a html syntax by using reg exps in php? I mean i have a text like <h3>heading</h3> <p>text</p> <table> <tr> <td>cell1</td>
26
by: Dave Patton | last post by:
http://members.shaw.ca/davepatton/gps.html In another newsgroup(related to GPS), in regards to the above page, someone said:...
3
by: John young | last post by:
I have been looking for an answer to a problem and have found this group and hope you can assist . I have been re doing a data base I have made for a car club I am with and have been trying to...
2
by: José Joye | last post by:
Hello, I was wondering if there is a method that exists to replace multi-spaces within a string with single-space. eg: "12 3 4 56" --> "12 3 4 56" I think this could be done by...
5
by: Charles Law | last post by:
I have a document in the following style 1 Introduction 2 Next Heading 2.1 Sub-section Some text ... 2.2 Another Sub-section 2.2.1 Getting deeper 3 Another Major Heading...
5
by: MaxiWheat | last post by:
Hi, I would like to expose a situation that I would like to have informations about. Let's suppose I have a table that looks like this : <table cellspacing="0" cellpadding="0" border ="0">...
12
by: Charlie King | last post by:
As I understand it, the use of FIR* to replace heading tags with images in visually enabled CSS browsers is now frowned upon on the basis that some screen readers will *nor* read back text that is...
0
by: xavier.boneu | last post by:
Hi! I beg you to give me a hand on the following issue. I would like to know how could I read the field's heading (not the field name) using standard SQL. I created a new table and each...
1
by: neovantage | last post by:
Hey all, I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
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...
0
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,...
0
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...

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.