Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-05-2003, 07:47 AM   PM User | #1
GoGreen
New Coder

 
Join Date: Aug 2002
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
GoGreen is an unknown quantity at this point
Question How to make links in an Image slideshow open in another frame

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>
GoGreen is offline   Reply With Quote
Old 07-05-2003, 05:55 PM   PM User | #2
Mr J
Senior Coder

 
Join Date: Aug 2002
Location: UK
Posts: 2,789
Thanks: 2
Thanked 14 Times in 14 Posts
Mr J is on a distinguished road
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
Mr J is offline   Reply With Quote
Old 07-06-2003, 03:09 PM   PM User | #3
GoGreen
New Coder

 
Join Date: Aug 2002
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
GoGreen is an unknown quantity at this point
thanks for your answer, but...

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
GoGreen is offline   Reply With Quote
Old 07-06-2003, 05:52 PM   PM User | #4
Mr J
Senior Coder

 
Join Date: Aug 2002
Location: UK
Posts: 2,789
Thanks: 2
Thanked 14 Times in 14 Posts
Mr J is on a distinguished road
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
Mr J is offline   Reply With Quote
Old 07-06-2003, 10:36 PM   PM User | #5
scroots
Senior Coder

 
Join Date: Jun 2002
Location: UK
Posts: 1,137
Thanks: 0
Thanked 0 Times in 0 Posts
scroots is an unknown quantity at this point
<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
__________________
Spammers next time you spam me consider the implications:
(1) that you will be persuaded by me(in a legitimate mannor)
(2)It is worthless to you, when i have finished
scroots is offline   Reply With Quote
Old 07-06-2003, 11:25 PM   PM User | #6
Mr J
Senior Coder

 
Join Date: Aug 2002
Location: UK
Posts: 2,789
Thanks: 2
Thanked 14 Times in 14 Posts
Mr J is on a distinguished road
Not when you use

#null
Mr J is offline   Reply With Quote
Old 07-06-2003, 11:28 PM   PM User | #7
scroots
Senior Coder

 
Join Date: Jun 2002
Location: UK
Posts: 1,137
Thanks: 0
Thanked 0 Times in 0 Posts
scroots is an unknown quantity at this point
ok then, i didn't know you could use #null.

you learn something new everyday.

scroots
__________________
Spammers next time you spam me consider the implications:
(1) that you will be persuaded by me(in a legitimate mannor)
(2)It is worthless to you, when i have finished
scroots is offline   Reply With Quote
Old 07-07-2003, 08:14 AM   PM User | #8
GoGreen
New Coder

 
Join Date: Aug 2002
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
GoGreen is an unknown quantity at this point
We're almost there ...

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>
GoGreen is offline   Reply With Quote
Old 07-07-2003, 03:33 PM   PM User | #9
Mr J
Senior Coder

 
Join Date: Aug 2002
Location: UK
Posts: 2,789
Thanks: 2
Thanked 14 Times in 14 Posts
Mr J is on a distinguished road
Delete

<base target="hovedramme">

From your page, it is not required
Mr J is offline   Reply With Quote
Old 07-08-2003, 02:28 PM   PM User | #10
GoGreen
New Coder

 
Join Date: Aug 2002
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
GoGreen is an unknown quantity at this point
Still not working correct

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
GoGreen is offline   Reply With Quote
Old 07-08-2003, 03:52 PM   PM User | #11
Mr J
Senior Coder

 
Join Date: Aug 2002
Location: UK
Posts: 2,789
Thanks: 2
Thanked 14 Times in 14 Posts
Mr J is on a distinguished road
Are you wanting the page to load into the frame that contains the slideshow?
Mr J is offline   Reply With Quote
Old 07-08-2003, 03:56 PM   PM User | #12
Mr J
Senior Coder

 
Join Date: Aug 2002
Location: UK
Posts: 2,789
Thanks: 2
Thanked 14 Times in 14 Posts
Mr J is on a distinguished road
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.
Attached Files
File Type: zip slide.zip (2.4 KB, 98 views)
Mr J is offline   Reply With Quote
Old 07-15-2003, 09:01 PM   PM User | #13
GoGreen
New Coder

 
Join Date: Aug 2002
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
GoGreen is an unknown quantity at this point
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
GoGreen is offline   Reply With Quote
Old 07-16-2003, 12:41 AM   PM User | #14
canadianjameson
Senior Coder

 
Join Date: Jul 2003
Location: My pimped-out igloo in Canadia
Posts: 1,966
Thanks: 36
Thanked 0 Times in 0 Posts
canadianjameson is an unknown quantity at this point
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
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
canadianjameson is offline   Reply With Quote
Old 07-17-2003, 05:43 PM   PM User | #15
GoGreen
New Coder

 
Join Date: Aug 2002
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
GoGreen is an unknown quantity at this point
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
GoGreen is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:37 PM.


Advertisement
Log in to turn off these ads.