473,499 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying a Image within a scrollable box/canvas of fixed dimensions

Hi there, I am new to JavaScript and wonder if it could be used to
solve my problem, any help would be much appreciated!

I have a html web page which contains a table on the left hand side
and image on the right, both of which are updating. As the image
updates however it gets bigger and starts to look messy next to the
constant sized updating table.

I just wondered is it possible to use java script to place the ever
growing image into some fixed box/canvas on this page which contains
scroll bars when the image's size exceeds that of the box/canvas.

If this is possible could you perhaps help explain how it would be
done? Any ideas would be gratefully recieved! Thanks for your time

Regards
Chris
Mar 13 '08 #1
4 2289
SAM
cr***********@hotmail.com a écrit :
Hi there, I am new to JavaScript and wonder if it could be used to
solve my problem, any help would be much appreciated!

I have a html web page which contains a table on the left hand side
and image on the right, both of which are updating. As the image
updates however it gets bigger and starts to look messy next to the
constant sized updating table.

I just wondered is it possible to use java script to place the ever
growing image into some fixed box/canvas on this page which contains
scroll bars when the image's size exceeds that of the box/canvas.

If this is possible could you perhaps help explain how it would be
done? Any ideas would be gratefully recieved! Thanks for your time
It seems to be a CSS question ...
Put the image in an overflowed div
<http://www.w3.org/TR/CSS21/visufx.html#x0>

<table width="100%">
<tr>
<td width=120><img src="1.jpg" alt="small img"></td>
<td rowspan="5">
<div style="overflow:auto;height:500px">
<img src="1B.jpg" alt="big img">
</div>
</td>
</tr>

.....

</table>

All images to insert in the page are made with their right sizes
^^^^^^^^^^^^^^^^^^^^^^
The IMG tags have no size attributes (nor CSS sizing).

--
sm
Mar 13 '08 #2
On Mar 13, 12:13 pm, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
crazychris...@hotmail.com a écrit :
Hi there, I am new to JavaScript and wonder if it could be used to
solve my problem, any help would be much appreciated!
I have a html web page which contains a table on the left hand side
and image on the right, both of which are updating. As the image
updates however it gets bigger and starts to look messy next to the
constant sized updating table.
I just wondered is it possible to use java script to place the ever
growing image into some fixed box/canvas on this page which contains
scroll bars when the image's size exceeds that of the box/canvas.
If this is possible could you perhaps help explain how it would be
done? Any ideas would be gratefully recieved! Thanks for your time

It seems to be a CSS question ...
Put the image in an overflowed div
<http://www.w3.org/TR/CSS21/visufx.html#x0>

<table width="100%">
<tr>
<td width=120><img src="1.jpg" alt="small img"></td>
<td rowspan="5">
<div style="overflow:auto;height:500px">
<img src="1B.jpg" alt="big img">
</div>
</td>
</tr>

....

</table>

All images to insert in the page are made with their right sizes
^^^^^^^^^^^^^^^^^^^^^^
The IMG tags have no size attributes (nor CSS sizing).

--
sm
Fantastic sm that works like a charm!
Thankyou very much
Chris
Mar 13 '08 #3
Hi there I now have another question related to this issue.

Putting the image in a overflow div has worked well for when the image
size exceeds that of the div container, scrollable bars horizontally
and vertically are automatically provided. This image however is
gradually increasing after iterative refreshes (of 5 secs) and thus at
it does, the web page will only show the top left part of that image
unless you use the scroll bars to look around.

My question is therefore: Can you make the scroll bars which get
generated from the overflow div to automatically focus to the bottom
right part of the image after every refresh. If not do you have any
ideas of how I can go about adding this functionality.

This would then allow the user to see the latest part of the image
which gets generated after a refresh without having to move the scroll
bars.

Any help would be much appreciated!
Thanks
Chris

Mar 14 '08 #4
SAM
cr***********@hotmail.com a écrit :
Hi there I now have another question related to this issue.

Putting the image in a overflow div has worked well for when the image
size exceeds that of the div container, scrollable bars horizontally
and vertically are automatically provided. This image however is
gradually increasing after iterative refreshes (of 5 secs) and thus at
it does, the web page will only show the top left part of that image
unless you use the scroll bars to look around.

My question is therefore: Can you make the scroll bars which get
generated from the overflow div to automatically focus to the bottom
right part of the image after every refresh. If not do you have any
ideas of how I can go about adding this functionality.

This would then allow the user to see the latest part of the image
which gets generated after a refresh without having to move the scroll
bars.

<div id="oveflowed">
<img blah onload="this.marginTop=(this.height-500)+'px';" blah>

and then ... no more vertical lift ... no ?
in place of overflowed div :

<iframe name="viewer" src="myImage.jpg" height="500"></iframe>

My Fx displays the image sized to maxi the free space
a click on the image zoom to normal or back to reduce size

to display another image :

parent.viewer.location = 'myNewImage.jpg";

--
sm
Mar 14 '08 #5

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

Similar topics

3
11735
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
25
36319
by: Michael Schuerig | last post by:
I'm trying to do something seemingly very simple, but it's brought me close to crushing my head on the keyboard. All I want is a table where the head row is fixed and the body columns below are...
3
4645
by: Lyn | last post by:
I need some guidance for a technique that will allow me to accomplish the following... I have a table in which each record contains a photograph. I would like to display in a form a thumbnail...
5
3017
by: Sahil Malik [MVP] | last post by:
I am looking for suggestions on a software that can display an Org. Chart in a web based environment. The server runs .NET (2.0), and I have to add that the org chart must work on...
2
9395
by: sj | last post by:
I am just learning to use Tkinter and am having problems displaying image files. I am able to display an image using tutorials (such as http://www.daniweb.com/code/snippet296.html) But when I try...
8
3918
by: Warren Post | last post by:
At <http://snow.prohosting.com/srcopan/dry/test.es.html>, you will see that the background image runs down the left margin. The right hand side of it is faded, watermark style, but it is one single...
4
2660
by: redpears007 | last post by:
Hi Again, Throwing this one out to you again as i am not getting anywhere and can find little to no information out there. I am currently displaying images (Jpegs) in access via the routine...
3
2347
by: anniejose | last post by:
I am facing an issue in displaying a calendar popup on click of a calendar icon in one of my JSP pages. In my JSP page I have 3 calendar icons in a horizontally scrollable table. If I click the 1st...
1
4182
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
0
7134
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
7180
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
7229
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...
1
6905
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...
1
4921
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.