swapping text

N

Nina

I am using swap image behavior to change the pictures in the same layer when
the mouse goes over the images in the other layers. How do I get the
descriptions of the pictures to change in the same layer? Or do I have to add
another layer with text. Then how do I swap the text that goes with each
image.

Thanks, Nina
 
T

Trevor L.

Kevin said:
http://www.google.com/search?hl=en&q=JavaScript+image+swap

Off you go.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
We got a sick zebra a hat,
you ultimate tuna.

Hi again Nina,

One of the references google brought up from Kevin's suggestion is the
following example
I have modified it to add a caption which also alters on mouseover or
mouseup.

<head>
<title>My Page</title>
<head>
<script type="text/javascript">
if (document.images) {
var button1_up = new Image();
button1_up.src = 'button_up.gif";
var button1_over = new Image();
button1_over.src = 'button_over.gif";
}
function over_button() {
if (document.images) {
document["buttonOne"].src = button1_over.src
document.getElementById("caption").innerHTML = "Caption for
button_over.gif"
}
}
function up_button() {
if (document.images) {
document["buttonOne"].src = button1_up.src
document.getElementById("caption").innerHTML = "Caption for
button_up.gif"
}
}
</script>
<body>

<a href="file.html"
onMouseOver="over_button()"
onMouseOut="up_button()">
<img src="button_up.gif" alt="click me"
width="XX" height="YY" name="buttonOne"
border=0>
<span id="caption">Caption for button_up.gif</span>
</a>

</body>
</html>

You may have to make changes to get the caption exactly where you want it,
but it should work fine.
(I haven't tested this but my changes are small. Let me know if there are
problems)
 
N

Nina

Thanks Kevin and Trevor. I'm sorry to be slow on the uptake, but I'm not a
programmer and am not sure how to handle your suggestions. I was hoping to
use the Frontpage 2003 interface to solve the swapping text problem just as I
did with the swap image. If there is a simple explanation for how to insert
the code you suggest into Frontpage and how to tailor with my text, please
advise.

Nina

Trevor L. said:
Kevin said:
http://www.google.com/search?hl=en&q=JavaScript+image+swap

Off you go.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
We got a sick zebra a hat,
you ultimate tuna.

Hi again Nina,

One of the references google brought up from Kevin's suggestion is the
following example
I have modified it to add a caption which also alters on mouseover or
mouseup.

<head>
<title>My Page</title>
<head>
<script type="text/javascript">
if (document.images) {
var button1_up = new Image();
button1_up.src = 'button_up.gif";
var button1_over = new Image();
button1_over.src = 'button_over.gif";
}
function over_button() {
if (document.images) {
document["buttonOne"].src = button1_over.src
document.getElementById("caption").innerHTML = "Caption for
button_over.gif"
}
}
function up_button() {
if (document.images) {
document["buttonOne"].src = button1_up.src
document.getElementById("caption").innerHTML = "Caption for
button_up.gif"
}
}
</script>
<body>

<a href="file.html"
onMouseOver="over_button()"
onMouseOut="up_button()">
<img src="button_up.gif" alt="click me"
width="XX" height="YY" name="buttonOne"
border=0>
<span id="caption">Caption for button_up.gif</span>
</a>

</body>
</html>

You may have to make changes to get the caption exactly where you want it,
but it should work fine.
(I haven't tested this but my changes are small. Let me know if there are
problems)
 
T

Trevor L.

Nina said:
Thanks Kevin and Trevor. I'm sorry to be slow on the uptake, but I'm
not a programmer and am not sure how to handle your suggestions. I
was hoping to use the Frontpage 2003 interface to solve the swapping
text problem just as I did with the swap image. If there is a simple
explanation for how to insert the code you suggest into Frontpage and
how to tailor with my text, please advise.

Yes Nina,
I recall you from previous posts re your site on pollution in Europe. (I
hope you figured that out OK)

So what I posted is a complete HTML file

In FP, click on the Code or HTML tab and the HTML code will be there.

Paste what I wrote between <head> and </head> anywhere on the page you see
in the same place, i.e. between <head> and </head>

What I wrote between <body> and </body> is also to be pasted into the same
place, i.e. between <body> and </body>.

Anything else you have in the <head> or <body> section stays there.

P.S. If you post a URL, I can also look at that for you.
 
K

Kevin Spencer

Hi Nina,
Thanks Kevin and Trevor. I'm sorry to be slow on the uptake, but I'm not a
programmer and am not sure how to handle your suggestions.

Any time you talk about a web page or an application *doing* something, such
as swapping out an image when a certain event happens, you are talking about
programming. Programming is the art/science of writing instructions to a
computer application that cause it to perform some task or tasks.

Now, the reason I'm telling you this is that you say you're not a
programmer, but you asked "How do I get the descriptions of the pictures to
change in the same layer?" Of course, the reason you asked this is because
FrontPage provided a tool to write some JavaScript for you, in other words,
to do some programming for you, but you wanted it to do something just a wee
bit outside of what it was designed to do. And of course, not being a
programmer, you were stuck.

Now, just stick with me a for a little ways, and you'll see where I'm going
with this.

A program like FrontPage, Word, or, for example, any Microsoft Office
product, contains a number of tools to enable the user to add functionality
to the product they use that program to produce, such as a web page, a Word
document, etc. These are invariably the sorts of things that are most
commonly wanted by the users. But there are myriads of things which an HTML
page, for example, *could* do, and there is no way to make a large enough
set of tools to do them all. After all, for every tool, the user would have
to learn something more about how to use the program. How would you find the
one you were looking for among all those thousands of tools?

But wait, in fact, such a tool set *does* exist. And while you don't have to
"be a programmer" to use this set of tools, you *do* have to know something
about programming to use them. In fact, several sets of tools are available,
each one more difficult to use, but more powerful than the one above it.

For example, in Word (and in FrontPage), you can create macros. These macros
are written in VBA (Visual Basic for Applications). A macro is a set of
instructions that is relatively simple to put together. Each of these
instructions encapsulates a block of lower-level instructions in a
convenient manner, which requires less effort to learn.

In FrontPage, because you are working with a web page, you can also use
client-side scripting (JavaScript) to work with the objects in the HTML
document, to cause them to behave in a certain way, depending upon other
things (hence, the term "behavior"). JavaScript and VBScript are scripting
languages. A scripting language is similar to VBA, in that it is a
simplified type of programming based upon convenient combinations of
lower-level, more difficult to learn, programming instructions.

So, where I'm going with this is: Don't be afraid to learn a *little bit* of
"programming" (such as some JavaScript). After all, you were smart enough to
learn how to use FrontPage; obviously, you could learn a little JavaScript.
There are lots of web sites out there that have tutorials, demonstrations,
and articles about how to use it. And it's not exactly "programming." It's
"scripting." Think of it as "macros for web pages." Once you learn a little,
you may actually enjoy it! And you will be able to do a lot more of these
sorts of "just outside the lines" types of things in your web site, with
very little help.

And of course, when you *do* need help, we're all here to help each other!
:)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.


Nina said:
Thanks Kevin and Trevor. I'm sorry to be slow on the uptake, but I'm not a
programmer and am not sure how to handle your suggestions. I was hoping to
use the Frontpage 2003 interface to solve the swapping text problem just
as I
did with the swap image. If there is a simple explanation for how to
insert
the code you suggest into Frontpage and how to tailor with my text, please
advise.

Nina

Trevor L. said:
Kevin said:
http://www.google.com/search?hl=en&q=JavaScript+image+swap

Off you go.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
We got a sick zebra a hat,
you ultimate tuna.


I am using swap image behavior to change the pictures in the same
layer when
the mouse goes over the images in the other layers. How do I get the
descriptions of the pictures to change in the same layer? Or do I
have to add
another layer with text. Then how do I swap the text that goes with
each image.

Thanks, Nina

Hi again Nina,

One of the references google brought up from Kevin's suggestion is the
following example
I have modified it to add a caption which also alters on mouseover or
mouseup.

<head>
<title>My Page</title>
<head>
<script type="text/javascript">
if (document.images) {
var button1_up = new Image();
button1_up.src = 'button_up.gif";
var button1_over = new Image();
button1_over.src = 'button_over.gif";
}
function over_button() {
if (document.images) {
document["buttonOne"].src = button1_over.src
document.getElementById("caption").innerHTML = "Caption for
button_over.gif"
}
}
function up_button() {
if (document.images) {
document["buttonOne"].src = button1_up.src
document.getElementById("caption").innerHTML = "Caption for
button_up.gif"
}
}
</script>
<body>

<a href="file.html"
onMouseOver="over_button()"
onMouseOut="up_button()">
<img src="button_up.gif" alt="click me"
width="XX" height="YY" name="buttonOne"
border=0>
<span id="caption">Caption for button_up.gif</span>
</a>

</body>
</html>

You may have to make changes to get the caption exactly where you want
it,
but it should work fine.
(I haven't tested this but my changes are small. Let me know if there are
problems)
 
N

Nina

Hi Trevor,
Thank you so much for the additional information and sorry for the delay in
responding. I have had to stop working on my web site temporarily so I
haven't been able to try out the code you sent. Will let you know what
happens.

Thanks again, Nina

(BTW, don't know what you're referring to about the pollution in Europe. You
must be thinking of someone else since I never wrote about anything like
that.)
 
N

Nina

Hi Kevin,
Sorry for the delay in responding to your post. You point about learning
some programming is true. I do understand the concepts you talked about,
having been a techincal writer for IBM years ago. However, since the
functionality of Frontpage is not always intuitive, I can't always be sure of
what it can or cannot do w/o additional code. And since I am not a web site
designer, going back and forth between HTML and the Frontpage user interface
is not always easy.

Trevor's info. about placement of the code should be enough info. for me to
proceed. But I've had to stop working on the web site temporarily so haven't
tried it yet. I really appreciate the help from this forum!!!
Nina

Kevin Spencer said:
Hi Nina,
Thanks Kevin and Trevor. I'm sorry to be slow on the uptake, but I'm not a
programmer and am not sure how to handle your suggestions.

Any time you talk about a web page or an application *doing* something, such
as swapping out an image when a certain event happens, you are talking about
programming. Programming is the art/science of writing instructions to a
computer application that cause it to perform some task or tasks.

Now, the reason I'm telling you this is that you say you're not a
programmer, but you asked "How do I get the descriptions of the pictures to
change in the same layer?" Of course, the reason you asked this is because
FrontPage provided a tool to write some JavaScript for you, in other words,
to do some programming for you, but you wanted it to do something just a wee
bit outside of what it was designed to do. And of course, not being a
programmer, you were stuck.

Now, just stick with me a for a little ways, and you'll see where I'm going
with this.

A program like FrontPage, Word, or, for example, any Microsoft Office
product, contains a number of tools to enable the user to add functionality
to the product they use that program to produce, such as a web page, a Word
document, etc. These are invariably the sorts of things that are most
commonly wanted by the users. But there are myriads of things which an HTML
page, for example, *could* do, and there is no way to make a large enough
set of tools to do them all. After all, for every tool, the user would have
to learn something more about how to use the program. How would you find the
one you were looking for among all those thousands of tools?

But wait, in fact, such a tool set *does* exist. And while you don't have to
"be a programmer" to use this set of tools, you *do* have to know something
about programming to use them. In fact, several sets of tools are available,
each one more difficult to use, but more powerful than the one above it.

For example, in Word (and in FrontPage), you can create macros. These macros
are written in VBA (Visual Basic for Applications). A macro is a set of
instructions that is relatively simple to put together. Each of these
instructions encapsulates a block of lower-level instructions in a
convenient manner, which requires less effort to learn.

In FrontPage, because you are working with a web page, you can also use
client-side scripting (JavaScript) to work with the objects in the HTML
document, to cause them to behave in a certain way, depending upon other
things (hence, the term "behavior"). JavaScript and VBScript are scripting
languages. A scripting language is similar to VBA, in that it is a
simplified type of programming based upon convenient combinations of
lower-level, more difficult to learn, programming instructions.

So, where I'm going with this is: Don't be afraid to learn a *little bit* of
"programming" (such as some JavaScript). After all, you were smart enough to
learn how to use FrontPage; obviously, you could learn a little JavaScript.
There are lots of web sites out there that have tutorials, demonstrations,
and articles about how to use it. And it's not exactly "programming." It's
"scripting." Think of it as "macros for web pages." Once you learn a little,
you may actually enjoy it! And you will be able to do a lot more of these
sorts of "just outside the lines" types of things in your web site, with
very little help.

And of course, when you *do* need help, we're all here to help each other!
:)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.


Nina said:
Thanks Kevin and Trevor. I'm sorry to be slow on the uptake, but I'm not a
programmer and am not sure how to handle your suggestions. I was hoping to
use the Frontpage 2003 interface to solve the swapping text problem just
as I
did with the swap image. If there is a simple explanation for how to
insert
the code you suggest into Frontpage and how to tailor with my text, please
advise.

Nina

Trevor L. said:
Kevin Spencer wrote:
http://www.google.com/search?hl=en&q=JavaScript+image+swap

Off you go.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
We got a sick zebra a hat,
you ultimate tuna.


I am using swap image behavior to change the pictures in the same
layer when
the mouse goes over the images in the other layers. How do I get the
descriptions of the pictures to change in the same layer? Or do I
have to add
another layer with text. Then how do I swap the text that goes with
each image.

Thanks, Nina

Hi again Nina,

One of the references google brought up from Kevin's suggestion is the
following example
I have modified it to add a caption which also alters on mouseover or
mouseup.

<head>
<title>My Page</title>
<head>
<script type="text/javascript">
if (document.images) {
var button1_up = new Image();
button1_up.src = 'button_up.gif";
var button1_over = new Image();
button1_over.src = 'button_over.gif";
}
function over_button() {
if (document.images) {
document["buttonOne"].src = button1_over.src
document.getElementById("caption").innerHTML = "Caption for
button_over.gif"
}
}
function up_button() {
if (document.images) {
document["buttonOne"].src = button1_up.src
document.getElementById("caption").innerHTML = "Caption for
button_up.gif"
}
}
</script>
<body>

<a href="file.html"
onMouseOver="over_button()"
onMouseOut="up_button()">
<img src="button_up.gif" alt="click me"
width="XX" height="YY" name="buttonOne"
border=0>
<span id="caption">Caption for button_up.gif</span>
</a>

</body>
</html>

You may have to make changes to get the caption exactly where you want
it,
but it should work fine.
(I haven't tested this but my changes are small. Let me know if there are
problems)
 
T

Trevor L.

Nina said:
Hi Trevor,
Thank you so much for the additional information and sorry for the
delay in responding. I have had to stop working on my web site
temporarily so I haven't been able to try out the code you sent. Will
let you know what happens.

Great. I hope you find it useful
(BTW, don't know what you're referring to about the pollution in
Europe. You must be thinking of someone else since I never wrote
about anything like that.)

Sorry about that, the other poster also used the signature Nina.

So I assumed (wrongly) ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top