|
-
Aug 18th, 2004, 03:18 AM
#1
Thread Starter
Registered User
Opening a Picture in Iframe
Hey!!!
I M Trying to open a picture in an Iframe but the problem is that if the picture is bigger then the Iframe i get Scroll bars.
i wnat to be able to send the picture to the Iframe and not getting scroll bars meaning : i want to tell the Iframe to make the pictures smaller as the size of the Iframe.
what should i do ?
10x
-
Aug 19th, 2004, 02:14 AM
#2
Frenzied Member
mae the picture holder like this:
<img id="myimg" width="50" height="500" alt="my image" />
Then when you edit it's src attribute it'll still stay the same width andheight.
Have I helped you? Please Rate my posts. 
-
Aug 19th, 2004, 02:38 AM
#3
Thread Starter
Registered User
This is the code :
<a href=HodHasharon_Big_1.jpg border=0 target="BigPic" width=30 height=30>
<img src=HodHasharon_Big_1.jpg height=100 width=120></Img></a>
my Iframe Name is BigPic and then when i click the picture It opens in the frame.
and i want the frame to be able to open the picture smaller then it realy is and not adding scroll bars to it self.
10X
-
Aug 19th, 2004, 02:55 AM
#4
Frenzied Member
ok. firstly that code is wrong. </img> doesn't exist... among other mistakes.
You'l have to use JavaScript for this. here's some untested code.
Iframe code (iframe.html):
Code:
<html>
<img id="myimg" width="50" height="500" alt="my image" />
</html>
the main page:
Code:
<html>
<script type="text/javascript">
function doIt(img) {
document.getElementById('myIfr').myimg.src=img
}
</script>
<iframe src="iframe.html" id="myIfr"></iframe>
<button onClick="doIt('me.jpg')"><img src="me.jpg" /></button>
</html>
As I said, that's untested. I've never been good at that part of the DOM, so I won't be suprised if it doesn't work. I very rarely use iframes or even frames myself. If the entire purpose of this iframe is to hold these images, then just use an image holder, not an iframe.
Have I helped you? Please Rate my posts. 
-
Aug 24th, 2004, 09:40 AM
#5
Frenzied Member
Originally posted by Acidic
ok. firstly that code is wrong. </img> doesn't exist... among other mistakes.
You'l have to use JavaScript for this. here's some untested code.
Iframe code (iframe.html):
Code:
<html>
<img id="myimg" width="50" height="500" alt="my image" />
</html>
the main page:
Code:
<html>
<script type="text/javascript">
function doIt(img) {
document.getElementById('myIfr').myimg.src=img
}
</script>
<iframe src="iframe.html" id="myIfr"></iframe>
<button onClick="doIt('me.jpg')"><img src="me.jpg" /></button>
</html>
As I said, that's untested. I've never been good at that part of the DOM, so I won't be suprised if it doesn't work. I very rarely use iframes or even frames myself. If the entire purpose of this iframe is to hold these images, then just use an image holder, not an iframe.
You're using the XHTML 'close all tags' thing - don't confuse him more than neccessary
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Aug 25th, 2004, 03:24 PM
#6
Frenzied Member
VbNeo: Xhtml once will replace html, so why not learn it now? It's not that hard at all.
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Aug 26th, 2004, 09:11 AM
#7
Frenzied Member
Originally posted by Jop
VbNeo: Xhtml once will replace html, so why not learn it now? It's not that hard at all.
You should, however, have made him aware of that - since changes would be he would make a non valid hybrid between HTML 4.01 and XHTML utilizing what you gave him.
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|