...

View Full Version : How to make links in an Image slideshow open in another frame



GoGreen
07-05-2003, 07:47 AM
Hi everybody
I've tried to change almost everything in this blending image slideshow script, but I can't figure out how to make it open links in the correct frame.
Can you help me please?

I've pasted the code at the end, the link to my page is here:
http://husoghave.hosted4free.dk/

With thanks in advance
Kind regards
GoGreen

The code:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Ny side 2</title>
<base target="indhold">
<script language="JavaScript1.1">
<!--

//*****************************************
// Blending Image Slide Show Script-
// Dynamic Drive (www.dynamicdrive.com)
// For full source code, visit http://www.dynamicdrive.com/
//*****************************************

//specify interval between slide (in mili seconds)
var slidespeed=3000

//specify images
var slideimages=new Array("hoens.jpg","affald1.jpg","agurk.jpg")

//specify corresponding links
var slidelinks=new Array("hons.htm","affald.htm","indretning.htm")

var newwindow=0 //open links in new window? 1=yes, 0=no

var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=indhold[whichlink]
}

//-->
</script>
</head>

<body bgcolor="#005300">


<p align="center">


&nbsp;


<p align="center">


<a href="javascript:gotoshow()"><img src="hoens.jpg" name="slide" border=0 style="filter:blendTrans(duration=3)" width=100 height=300></a>

<script language="JavaScript1.1">
<!--

var whichlink=0
var whichimage=0
var blenddelay=(ie)? document.images.slide.filters[0].duration*5000 : 0
function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+blenddelay)
}
slideit()

//-->
</script>

<p align="center">&nbsp;</p>

</body>

</html>
:confused: :confused:

Mr J
07-05-2003, 05:55 PM
In

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=indhold[whichlink]
}

Have you tried changing

window.location=indhold[whichlink]


for

parent. framename.location=indhold[whichlink]

Where framename is the name of your frame

GoGreen
07-06-2003, 03:09 PM
I'm very greatfull for yo9ur answer, thank you so much - but its still not working...

I've tried your suggestion, both with and without a space between:
parent. framename

I don't know what to do. Something is completely wrong. I've even tried to make the code from scratch, inserting the filenames for the pictures again and so on - the new page is not working either.
So if you have any other suggestions, I'll be very greatfull.

I've even thought of making the links to open the site again using the link to the actual page and using the "stay in frames" code - but I keep thinking, that it shouldt be nessesary.

Please - everybody... Any suggestions - any at all will be very very welcome.

With many thanks in advance
Kind regards
GoGreen

Mr J
07-06-2003, 05:52 PM
I have found three areas that need looking at:

Delete

<base target="indhold">


In function gotoshow()

Change

window.location=indhold[whichlink]

To

parent.main.location=slidelinks[whichlink]

Change main to the name of your frame

In your link

Change

<a href="java script:gotoshow()">

To

<a href="#null" onclick="gotoshow()">


I have had it working in a test frame in IE5.5

scroots
07-06-2003, 10:36 PM
<lecture type="short" author="brothercake">
a technique is to use <a href="javascript:gotoshow">
or use <a href="javascript://"> as the # takes you to the top of the page.
</lecture>


scroots

Mr J
07-06-2003, 11:25 PM
Not when you use

#null

scroots
07-06-2003, 11:28 PM
ok then, i didn't know you could use #null.

you learn something new everyday.

scroots

GoGreen
07-07-2003, 08:14 AM
Hi everybody
Thank you SO MUCH for all you help, now it's almost working - I'm very very greatfull for all your help.

But theres still something... Cause when you click on the slideshow, the slideshow opens in the correct frame, but it should be the link associated with the slideshow that opens in the frame.
Well, that's not a good explanation, you can see it here:
http://husoghave.hosted4free.dk/

I must have screwed up something in the script, but I don't know where. I thought I made all your suggested changes correct, but I don't know, where I went wrong.

I've pasted the script down below, and hope you can help me once againg.

I'm very greatfull for your help. With thanks in advance
Kind regards
GoGreen

- the code -

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Ny side 2</title>
<script language="JavaScript1.1">
<!--

//*****************************************
// Blending Image Slide Show Script-
// Dynamic Drive (www.dynamicdrive.com)
// For full source code, visit http://www.dynamicdrive.com/
//*****************************************

//specify interval between slide (in mili seconds)
var slidespeed=3000

//specify images
var slideimages=new Array("hoens.jpg","affald1.jpg","agurk.jpg")

//specify corresponding links
var slidelinks=new Array("hons.htm","affald.htm","indretning.htm")

var newwindow=0 //open links in new window? 1=yes, 0=no

var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
parent.hovedramme.location=slidelinks[whichlink]
}

//-->
</script>
<base target="hovedramme">
</head>

<body bgcolor="#005300">


<p align="center">


&nbsp;


<p align="center">


<a href="#null" onclick="gotoshow()"><img src="hoens.jpg" name="slide" border=0 style="filter:blendTrans(duration=3)" width=100 height=300></a>

<script language="JavaScript1.1">
<!--

var whichlink=0
var whichimage=0
var blenddelay=(ie)? document.images.slide.filters[0].duration*5000 : 0
function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+blenddelay)
}
slideit()

//-->
</script>

<p align="center">&nbsp;</p>

</body>

</html>

Mr J
07-07-2003, 03:33 PM
Delete

<base target="hovedramme">

From your page, it is not required

GoGreen
07-08-2003, 02:28 PM
Thanks, but it didn't change the fact, that its the slideshow that opens up in the frame, and not the link associated with the picture in the slideshow.

Please, anyone - any suggestions of how to fix it???

With thanks in advance,
Kind regards
GoGreen

Mr J
07-08-2003, 03:52 PM
Are you wanting the page to load into the frame that contains the slideshow?

Mr J
07-08-2003, 03:56 PM
Here are the files that I have been working with.

It is a 3 frame frameset, header frame, left frame containing the slider, and a right frame

When an image is clicked the corresponding page is loaded into the right frame.

Add your images to the folder.

GoGreen
07-15-2003, 09:01 PM
Dear Mr. J
I'm very sorry that I havent given any response before now, but I've been on vacasion, and got home an hour ago.
I'm very greatfull for your answer, which I'll try first thing in the morning. Right now I'm too tired to make any script work ;-)
I would just like to thank you very much for your answer, and as Arnold says: I'll be back - with a description if I can make it work or not. It seem though, that you have made a very very good solution to what I need.
Again, I thank you for ypur answer.
Kind regards
Hope you enjoy the nice summer
GoGreen

canadianjameson
07-16-2003, 12:41 AM
i cant help you with your script, but i do have a suggestion for the actual page (http://husoghave.hosted4free.dk/)

everything is green, but the scrollbars are still gray. you can change their color easily by using this code to modify the colors (code goes in the <head>)

<style>
<!--
BODY{
scrollbar-face-color:#75EA00;
scrollbar-arrow-color:brown;
scrollbar-track-color:#EEEEEE;
scrollbar-shadow-color:'';
scrollbar-highlight-color:'';
scrollbar-3dlight-color:'';
scrollbar-darkshadow-Color:'';
}
-->
</style>

and just make them the appropriate colors :)

GoGreen
07-17-2003, 05:43 PM
Hi everybody
First of all I would like to thank you all for your help regarding the slideshow and the suggestions for making colors on my scrollbar.

First regarding the links/images-script:
Dear Mr J, when I downloaded your file it worked fine, however I can't make it work with the coding in my own frames. I don't know why...

Dear canadianjameson, a very good sugestion, thanks. I've tried it out, however I can't seem to figure out how to place the code in my stylesheet (css). It works fine, if I put the code on each and every page, but I would like to be able to make quick changes in colors and so on at my homepage, therefore I use the stylesheet and not a code on each of my pages.
When I figure out how to make the changes in my stylesheet, I'll make the changes on my site. Thanks for your suggestion.

Back to the blending-image-slide-show: I've given up...
I've use many many hours to make the links associates with each picture to open correct in the frame. And you guys/girls have been more than helpfull, even though its still not working. SO...

Do you have any other suggestions for something nice, that could "spice up" my homepage INSTEAD of this particular slideshow, I would be very greatfull.

For now I'll just look around for something new, which I hope, I can make work.

Thank you all for your time and efforts.

Kind regards
GoGreen:o

Mr J
07-17-2003, 05:50 PM
Just add the following to your .css file, if you already have a rule for your BODY tag then just add the scrollbar attributes to it

BODY{
scrollbar-face-color:#75EA00;
scrollbar-arrow-color:brown;
scrollbar-track-color:#EEEEEE;
scrollbar-shadow-color:'';
scrollbar-highlight-color:'';
scrollbar-3dlight-color:'';
scrollbar-darkshadow-Color:'';
}

GoGreen
07-17-2003, 06:01 PM
Thanks Mr J - youre the greatest :thumbsup:

Its working - but you can't see the changes online yet though. But in my browser it works just fine. GREAT.
Thanks again

My kindest regards
GoGreen

GoGreen
07-17-2003, 06:03 PM
BTW
The mistake I made was to start with <stylet> ....
Thats why I couldn't make it work at first, thank you so much for your help AGAIN
:)
GoGreen

Mr J
07-17-2003, 06:19 PM
I have just been to have another look at your site and in the page containing the fade script you still have


<base target="hovedramme">

This line needs deleting

This is why the fade script is being shown in the other frame



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum