set image src via variable

J

Jim T

New to Front Page (using 2000), my background in VBA. I've research various
ways to add a slide show to a page in my web. I've add to a page an activeX
Forms2.0 command button and script block code added to the page HTML to set
a variable to the different pictures file names.

My current stumbling block is I don't know how to take the variable from
the script(for example mypic = "picture_1.jpg") and set the variable in the
HTML image statement

<p><img border="0" src= mypic
width="800" height="600"><!--mstheme--></font></body>

Is this possible? Alternatives (other than banner_ad which only allows for
10 entries, PowerPoint (seem like it would create a lot of extra "stuff"),
and I don't know Java so I'm trying to stick with VB.

Thanks
Jim T.
 
S

Steve Easton

You're making it way to hard.

Google for "javascript slide show" with the quotes.

Also, a lot of folks have WSH disabled which will kill your VBA.


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
J

Jim Carlock

Jim T said:
My current stumbling block is I don't know how to take
the variable from the script(for example
mypic = "picture_1.jpg") and set the variable in the HTML
image statement
<snip content="posted HTML">
<img border="0" src="mypic" width="800" height="600">
</snip>

JavaScript is the way to go... Forms2.0 dll might be
restricted from distribution by Microsoft, meaning only
folks with the proper version of Office would be able
to run the product.

Furthermore, JavaScript (ECMAScript) is a published
and accepted standard for the web-browser community
in general. Most web-browsers support JavaScript (aka,
ECMAScript). Only one browser supports vbScript.

The following html and JavaScript should get you started.

<html>
<head>
<title>Sample Javascript Function To Display A Picture</title>
<script language="javascript" type="text/javascript">//<!--
function DoShowMyPic(sMyPic) {
// var sMyPic = "./images/MyPic.jpg";
document.write('<img border="0" src="' + sMyPic + '" width="800" height="600" />');
}
//-->
</script>
</head>
<body>
<p><script language="javascript" type="text/javascript">
DoShowMyPic("./images/MyPic.jpg");
</script></p>
</body>
</html>

Learning javascript is well worth all effort. Java and
JavaScript are two different languages. They're similar in
some ways. Stick with JavaScript and don't run around
calling it java when you really mean javascript.

Hope this helps.

--
Jim Carlock
Post replies to the newsgroup, thanks.

"Jim T" <[email protected]> stated:
New to Front Page (using 2000), my background in VBA. I've research various
ways to add a slide show to a page in my web. I've add to a page an activeX
Forms2.0 command button and script block code added to the page HTML to set
a variable to the different pictures file names.

Is this possible? Alternatives (other than banner_ad which only allows for
10 entries, PowerPoint (seem like it would create a lot of extra "stuff"),
and I don't know Java so I'm trying to stick with VB.

Thanks
Jim T.
 

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