Current location: Hot Scripts Forums » General Web Coding » JavaScript » js function / border & iframe


js function / border & iframe

Reply
  #1 (permalink)  
Old 07-24-05, 01:55 AM
cityonfire cityonfire is offline
New Member
 
Join Date: Jul 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
js function / border & iframe

hey all

i'm new to these forums and had a quick question i was hoping someone could help me out with. i'll try to be as clear as possible.

basically what i have is, when the site i am working on is opened, an iframe that looks something like this:

Code:
<iframe src="blank.html" name="contact" id="contact" frameborder="0"> </iframe>
basically the deal is that when this site is opened, the iframe is filled with a blank html file and has a frameborder set to "0" so that the frame appears invisible, even though obviously it is still there. next, i have a script that, when a link is clicked, makes the border of the frame visible and fills it with the contents of an actual page of my site...here's what i mean:

Code:
//here's the script to give the iframe a border
</script>

<script type="text/javascript">
function killBorder(frameAppear)
{
document.getElementById(frameAppear).style.border = "2px solid #808080";
}
</script>

//once again, the frame
<iframe src="blank.html" name="contact" id="contact" frameborder="0"> </iframe>

//here's me calling the script and filling the iframe with contact.html
<a href = "contact.html" onClick="getBorder('contact')" target="contact"> contact </a>
up until this point everything is working fine...next comes the problem...i want to have an additional link, this time within the iframe (meaning within contact.html) that, when clicked, fills the contents of the iframe back with blank.html and sets the border back to 0...this is where i'm having problems...here's what i have:

Code:
//this is my script to kill the border (#f5f5f5 is the BG color)
</script>

<script type="text/javascript">
function killBorder(frameDisappear)
{
document.getElementById(frameDisappear).style.border = "0px none #f5f5f5";
}
</script>

//here's me calling it
<a href = "blank.html" onClick="killBorder('self')"> close </a>
in case it isn't obvious at first, the effect is to make the border visible when the first link is clicked, and make it invisible when the link within the iframe is clicked...when the link is clicked, blank.html loads in the iframe just fine, but the border remains...i can't get rid of it...hopefully i explained that clearly...if its easier to think of it this way, basically i just need help being able to make the frameborder invisible by clicking a link within the iframe using CSS...sorry for the long-winded explanation...any suggestions?

thanks guys-
Reply With Quote
  #2 (permalink)  
Old 07-24-05, 08:02 PM
cityonfire cityonfire is offline
New Member
 
Join Date: Jul 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
nevermind...figured it out...thanks anyway all
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP upload prob minority ASP 1 06-27-05 08:35 AM
PHP Error Fairnie PHP 8 06-26-04 07:15 AM
Disable form fields to be submitted RickyRod JavaScript 2 05-24-04 10:15 AM
Problem with a sort table js function tdubyou JavaScript 0 05-03-04 09:19 AM
Help trim code down TheLaughingBandit JavaScript 0 09-02-03 09:50 AM


All times are GMT -5. The time now is 10:52 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.