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

Home Posts Topics Members FAQ

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="chang e();">
<option value="photos\5 857250r10198.jp g" selected>Ukrani an students welcome
us to TCI
<option value="photos\5 857729-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 1983
Larry R Harrison Jr wrote:
[...]
<select name="slide" onChange="chang e();">
<option value="photos\5 857250r10198.jp g" selected>Ukrani an students
welcome us to TCI
<option value="photos\5 857729-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.getEl ementById)
{
this.getElemByI d = function getElemById(id)
{
return document.getEle mentById(id);
}
}
else if (document.all)
{
this.getElemByI d = function getElemById(id)
{
return document.all(id );
}
}
else if (document.layer s)
{
this.getElemByI d = function getElemById(id)
{
return document.layers[id];
}
}
else
{
this.getElemByI d = function getElemById()
{
return null;
}
}

function ap(v)
{
// ...
var descr = getElemById("de scr");
if (descr)
{
if (descr.firstChi ld) descr.firstChil d.nodeValue = v; // DOM 2+
else if (descr.innerHTM L) descr.innerHTML = v; // DOM 0
else if (descr.innerTex t) 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.n et/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
3719
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
2429
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: ---------------------------------------------------------------------- That page has quite a cryptic title: "CIS: GPS". I saved the URL in my browser but changed the title to "Patton's GPS pages". The headings are rather haphazard. For example, the first one ("On This Page") is a third level heading (an <h3>),...
3
579
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 make a query that selects from a table as desribed below .. I have a table (Volunteer) that has a member field (memnumber) and a number of fields that are headed in various categories and are yes/no formated
2
5078
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 looking at each char within a loop and copying the char to a stringBuilder instance if current and previous char are not spaces...
5
5674
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
3327
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"> <tr> <td><h1>Heading Something</h1></td>
12
2560
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 marked up by CSS to be invisible or hidden. So... If I want to replace headings with images (because my client wants to use his specific font for headings where possible), what's the best way to do it?
0
1418
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 field has its name, data type *and* heading.
1
3387
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. The problem is when it creates transparent PNG format image then and it pixel ate the image. e.g. If i am using a gradient in background then it vary in color range. Now when i used that php script it generates image successfully but it pixel ate...
0
8236
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
8173
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,...
1
8335
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
8475
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...
1
6110
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
5563
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
4079
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
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1482
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.