473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

change img.src in different frame

hi everyone! i'm working on a little portfolio site and would now really appreciate some help, since i'm stuck. the thing is i got thumbnails in one frame, and would like to, as you click on a thumbnail, change the img src in another frame.

i tried to make it somehting like this, which didn't work..

frame 1:

<img src="thumbnail1.jpg" onclick="top.frame2.photoview.src=''photo1.jpg;">

frame 2 (named "frame2"):

<img src="photo.jpg" id="photoview">

probably it's just some simple error somewhere, i ain't all that gifted in javascript, but anyways, someone help me? please?
Oct 9 '07 #1
3 2174
dmjpro
2,476 2GB
hi everyone! i'm working on a little portfolio site and would now really appreciate some help, since i'm stuck. the thing is i got thumbnails in one frame, and would like to, as you click on a thumbnail, change the img src in another frame.

i tried to make it somehting like this, which didn't work..

frame 1:

<img src="thumbnail1.jpg" onclick="top.frame2.photoview.src=''photo1.jpg;">

frame 2 (named "frame2"):

<img src="photo.jpg" id="photoview">

probably it's just some simple error somewhere, i ain't all that gifted in javascript, but anyways, someone help me? please?
Have a careful look............

Expand|Select|Wrap|Line Numbers
  1. <img src="thumbnail1.jpg" onclick="top.document.frames["frame2"].document.getElementById("photoview").src='photo1.jpg;'">
  2.  
Debasis Jana
Oct 9 '07 #2
Have a careful look............

Expand|Select|Wrap|Line Numbers
  1. <img src="thumbnail1.jpg" onclick="top.document.frames["frame2"].document.getElementById("photoview").src='photo1.jpg;'">
  2.  
Debasis Jana
thanks a lot! worked in ie, but not in firefox?

EDIT: the ff error console says "top.document.frames has no properties"
Oct 9 '07 #3
dmjpro
2,476 2GB
thanks a lot! worked in ie, but not in firefox?

EDIT: the ff error console says "top.document.frames has no properties"
I think this is "Standard" code for all browsers.
So wait for the Experts like "Gits" or "Acoder" ..... let them see your problem.
Have a good day !

Debasis Jana
Oct 10 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Brian Quigley | last post by:
hi... i have a site with 3 frames - menu, top and main. i want to click a link in the menu frame and change the top and main frame. how can i so this ? thanks, Brian Quigley
2
by: google | last post by:
I have a HTML file that contains an iframe. The HTML file is served by one server. The iframe contains a link to a completely different server. My question is, can any action in the iframe (such...
2
by: David Cho | last post by:
My button to print a document is in one frame, but the target doc is in a different one. The button ======= <input type="submit" name="btnPrint" value="Print Application" id="btnPrint"...
2
by: RWD | last post by:
I am trying to figure out how to change the target frame in my hyperlink on a DHTML menu. The menu is in one frame and the target frame is called "main" The code is below: Thanks in advance...
3
by: Jofio | last post by:
In my frame based page, I have a hyperlink in the top frame called "header" which, when I click, should make two different pages to be loaded and displayed into two different frames, namely...
3
by: dana lees | last post by:
Hi, I'm writing a C# asp.net web application. I have a frameset in which the upper frame contains a "print" button and the lower frame contains content of a different domain. Since i cannot...
7
by: Leoa | last post by:
Hi All, I'm having a hard time figuring out the DOM syntax to get one frame that has thumnails of images to display at full size in another frame (onmouseover). I looked at a couple...
3
by: perhapscwk | last post by:
2 frame....i want to make it when i click the button fom left frame, it will generate a option box in right frame. By click different button in left frame, the option box generate from right...
2
by: gm04030276 | last post by:
Hey all, Im trying to create a thing that will essentially allow me to use tabbed browsing within a website using php sessions to store the different opened pages. To do this, im using two frames,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.