Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Problem with show/hide a table within a resizable iframe.
Old 12-13-2007, 03:09 PM Problem with show/hide a table within a resizable iframe.
Junior Talker

Posts: 3
Name: Fred Lefranc
Location: Paris, FR
Trades: 0
Hi,

here's the situation :

a html page, with an iframe which resize itself to display the whole called file without scrolling bar.
one of the iframe's html file got hidden <div>.
clicking the menu will toggle show/hide these hidden <div>.

here's the trouble :
the iframe get its height with <div> hidden on the loading,
when i click to show the <div> part, the iframe keeps its base height and scrooling bars appears.

is there any way to resize the iframe when i show/hide the <div> ?
Friedd is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-13-2007, 08:57 PM Re: Problem with show/hide a table within a resizable iframe.
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Code or a link to the page in question would help.

You might need to resize the iframe with javascript at the same time the div gets clicked. Are you using javascript to show/hide the div? If so you should be able to add code in the same function that handles the show/hide to change the size of the iframe.

Hard to say for certain without seeing some code.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 12-15-2007, 07:21 PM Re: Problem with show/hide a table within a resizable iframe.
Junior Talker

Posts: 3
Name: Fred Lefranc
Location: Paris, FR
Trades: 0
Quote:
Code or a link to the page in question would help.
Yes sure !
http://friedd.free.fr/leperiscope/
click on "kaolin" on the left menu.

Quote:
Are you using javascript to show/hide the div?
yes i do,
Code:
<script type="text/javascript">
function toggle(id) {
    document.getElementById(id).style.display = (document.getElementById(id).style.display == "block")?"none":"block";
}
</script>
and
Code:
onMouseDown="javascript:toggle('element1')"
on the words that show/hide the <div>

Quote:
you should be able to add code in the same function that handles the show/hide to change the size of the iframe
as i don't really know javascript, i would love you to tell me what should i add to the code to do that !!
Friedd is offline
Reply With Quote
View Public Profile
 
Old 12-16-2007, 12:09 AM Re: Problem with show/hide a table within a resizable iframe.
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
I did this really quick, but try:

HTML Code:
<script type="text/javascript">
function toggle(id) {
    document.getElementById(id).style.display = (document.getElementById(id).style.display == "block")?"none":"block";
    
    if (document.getElementById(id).style.display == "block") {
        document.getElementById("main").height +=20px;
    else
        document.getElementById("main").height -=20px;
}
}
</script>
The 20px is a guess. I think that will add 20px (or whatever is necessary) when the div is shown and will subtract that 20px when the div gets hidden again.

I'm not 100% sure this will work, but give it a try.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 12-16-2007, 04:29 AM Re: Problem with show/hide a table within a resizable iframe.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The height calculation ( +=20px; )

should be (+=20) + "px";
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-16-2007, 06:12 AM Re: Problem with show/hide a table within a resizable iframe.
Junior Talker

Posts: 3
Name: Fred Lefranc
Location: Paris, FR
Trades: 0
thanks guys, this can be a temporary solution, but i'll soon add a database in one of the <div> to show upcoming events.
so i'm looking for something that'll dynamically resize the iframe with the good amount of px.

anything else ?
Friedd is offline
Reply With Quote
View Public Profile
 
Old 12-17-2007, 09:58 PM Re: Problem with show/hide a table within a resizable iframe.
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Oops Chris. See what I get for typing too fast.

Fred if you want a better solution I'd suggest something other than using an iframe. If you're pulling info from a database there's no reason first load it onto a different file and then pull that file into an iframe.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by vangogh; 12-17-2007 at 10:00 PM..
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to Problem with show/hide a table within a resizable iframe.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.71290 seconds with 12 queries