473,386 Members | 1,819 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,386 software developers and data experts.

Frames and Images

I have a page which has two frames ('content' on left and 'main' on right).
In the 'content' frame are various links which I wish to use to change the
image in the 'main' frame but leave the rest of the frame details intact.
I have named the image as 'mainimage' with the following -

<p align="center"><img border="1" src="imagedir/picture1.jpg"
name="mainimage" width="390" height="293"></p>

I am trying to right a piece of script which will change the image when user
click on the various links. I would have thought that the following would
have worked but all it seems to do is right the image name in the main
frame.

href="javascript:parent.main.document.images['mainimage'].src =
'imagedir/picture2.jpg'"

Any suggestions as to where I am going wrong would be appreciated.

Thanks
Peter
Jul 20 '05 #1
4 1745
On Tue, 23 Sep 2003 19:02:29 +0000 (UTC), "pete" <pe*****@this.com>
wrote:
I have a page which has two frames ('content' on left and 'main' on right).
In the 'content' frame are various links which I wish to use to change the
image in the 'main' frame but leave the rest of the frame details intact.
I have named the image as 'mainimage' with the following -

<p align="center"><img border="1" src="imagedir/picture1.jpg"
name="mainimage" width="390" height="293"></p>

Try changing name="mainimage" to id="mainimage", or just use them both
(name and id).
I am trying to right a piece of script which will change the image when user
click on the various links. I would have thought that the following would
have worked but all it seems to do is right the image name in the main
frame.
It sounds like you are trying to display an image that the script
can't find. Be sure the path and spelling is correct, as well as the
capitalization. I've been frustrated in situations like this many
times in the past, only to discover that I had type the image's name
incorrectly. Remember that myimage.jpg and MyImage.JPG are not the
same file as far as your script is concerned.

href="javascript:parent.main.document.images['mainimage'].src =
'imagedir/picture2.jpg'"

Any suggestions as to where I am going wrong would be appreciated.

Thanks
Peter

Jul 20 '05 #2
Hello,
I'm a beginning graphic/web designer. I created a website with a background
graphic that is 800x640 pixels. The problem is on my screen it fits like it
should (no scrolling necessary etc.) but on monitors with lower (different
resolutions) it's way too large. What script can I use to make sure the
background image is the same or similar size (fits within the browser window
without need for scrollling) on all or the majority of monitors? I'm sure
this is really simple javascript 101 but I'd appreciate the time and help.

designgal
Jul 20 '05 #3
Not a lot of success.
I have tried using id=... and name=... but I get the same result. The main
frame blanks out and just displays the text "imagedir/picture2.jpg".

Anyone got any other ideas?

Thanks
Peter
"Joseph Ellis" <ja*******@hotmail.com> wrote in message
news:42********************************@4ax.com...
On Tue, 23 Sep 2003 19:02:29 +0000 (UTC), "pete" <pe*****@this.com>
wrote:
I have a page which has two frames ('content' on left and 'main' on right).In the 'content' frame are various links which I wish to use to change theimage in the 'main' frame but leave the rest of the frame details intact.
I have named the image as 'mainimage' with the following -

<p align="center"><img border="1" src="imagedir/picture1.jpg"
name="mainimage" width="390" height="293"></p>


Try changing name="mainimage" to id="mainimage", or just use them both
(name and id).
I am trying to right a piece of script which will change the image when userclick on the various links. I would have thought that the following would
have worked but all it seems to do is right the image name in the main
frame.


It sounds like you are trying to display an image that the script
can't find. Be sure the path and spelling is correct, as well as the
capitalization. I've been frustrated in situations like this many
times in the past, only to discover that I had type the image's name
incorrectly. Remember that myimage.jpg and MyImage.JPG are not the
same file as far as your script is concerned.

href="javascript:parent.main.document.images['mainimage'].src =
'imagedir/picture2.jpg'"

Any suggestions as to where I am going wrong would be appreciated.

Thanks
Peter


Jul 20 '05 #4
"aundrenash" <au********@cox.net> writes:
I created a website with a background graphic that is 800x640
pixels. The problem is on my screen it fits like it should (no
scrolling necessary etc.) but on monitors with lower (different
resolutions) it's way too large.
And so is it on browsers that don't take up the entire screen (like
mine, on a 1600x1200 desktop).
What script can I use to make sure the background image is the same
or similar size (fits within the browser window without need for
scrollling) on all or the majority of monitors?


That is actually not possible. There is no way to scale a background
image in CSS, which is what would be needed. Even if you can find the
size of the browser (don't look at the size of the screen, it doesn't
matter one bite), you can't scale the background to fit. You will have
to have several different backgrounds available, and switch to the one
that has the correct size.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: BoodieMan | last post by:
The second example doesnt show any borders between frames, but isn't complaiant with the WC3. The top one is compliant but shows the borders. I'd like to get the complaint one to not show any...
7
by: millhauser | last post by:
I built my portfolio with Dreamweaver MX. In the bottom frame, I have thumbnails of images. When you click on a thumbnail, it is supposed to load the full size image in a targeted part of the top...
1
by: Com Dot | last post by:
In a frameset, the menu frame has six buttons. I would like to use mouseOver on these buttons to make images change in another frame. Does anyone have a script or know of a working site where this...
25
by: Steal | last post by:
Hi at all I try to validate this page using the link: http://validator.w3.org/ but it return that this is not a valid HTML 4.01 page please where is it error? Steil <!DOCTYPE HTML PUBLIC...
3
by: Jim Cobban | last post by:
I have a set of web pages that are organized in pairs. One of each pair contains a graphic and the other is an extended description of the graphic. I am trying to set it up that selecting a single...
20
by: M.Siler | last post by:
Let me first by saying I am NOT a .net programmer, but am very skilled with ASP, JavaScript, HTML, DHTML, Flash development. I've been reading through posts here about Frames vs. Master Pages and...
0
by: jceddy | last post by:
Hi...I hope I am posting this in an appropriate place...if not, could some direct me to someplace better? Anyway, the problem I have is that I have a page with a table with two rows. The top...
10
by: AmyMC | last post by:
Hi, I've been buried in this project, which has a lot of pre-loaded images. The pages which have these images are frames.... and even with my best attempts to preload them all still most do not. ...
27
by: Murray R. Van Luyn | last post by:
Hi, Is using frames in a website as big an issue nowadays as it was maybe 5 or so years ago? I can remember that you used to have to have a frame site, as well as a non frame site for browsers...
8
by: rn5a | last post by:
I have a HTML page named Index.html which is divided into 3 frames. The URL of 2 of the frames are HTML pages but the 3rd frame houses a ASP page. Now when I go to Windows Explorer, navigate to...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.