des bords autour de iframe qui ne veullent pas partir
Bonjour, J'ai un problème avec mes iframes qui m'arrachent les cheveux.
J'ai un iframe dans une div, quoi de plus normal, mais je n'arrive pas à enlever les bords. Après plusieurs jours de galère, je suis arrivé à l'enlever sur IE8 mais pas sur FF ni Safari :( Merci à toute personne pouvant m'aider.
Voici mon code:
La page html appelée par l'iframe
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <html>
<head>
<title>Sign up for our newsletter</title>
</head>
<body style="background: #ffffff; border:none; margin-left:20px; margin-right:20px">
<h4>Sign up for our newsletter!</h4>
<form id="myform">
<p>Enter your email address please:<br>
<input id="emailfield" type="text" name="T1" size="30" />
<input type="button" value="Ok" name="B1" onClick="parent.emailwindow.hide()" /></p>
</form>
Description: This script- or should we say plugin- extends DHTML Window widget with modal windows support. A modal window differs from a regular DHTML window
</body>
</html> |
La div dans laquelle se trouve l'iframe
Code:
1 2 3 4 5 6 7 8 9 10
| .drag-contentarea{ /*CSS for Content Display Area div*/
border-right: : 1px solid #000099;
border-bottom: : 1px solid #000099;
border-top: : none;
border-left: : none;
background-color: white;
color: black;
margin: 0px;
overflow: auto;
} |
La page qui appelle le tout
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>DHTML Modal Window demos</title>
<link rel="stylesheet" href="windowfiles/dhtmlwindow.css" type="text/css" />
<script type="text/javascript">
function opennewsletter(){
emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'modalfiles/newsletter.htm', 'Newsletter Signup page', 'width=417px,height=410px,center=1,resize=0,scrolling=0,frameborder=0','recal')
emailwindow.onclose=function()
{ //Define custom code to run when window is closed
var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
if (theemail.value.indexOf("@")==-1)
{ //crude check for invalid email
alert("Please enter a valid email address")
return false //cancel closing of modal window
}
else{ //else if this is a valid email
document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
return true //allow closing of window
}
}
} //End "opennewsletter" function
</script>
<a href="#" onClick="opennewsletter(); return false">Signup for our newletter</a> <span id="youremail" style="color: red"></span>
</body></html> |
D'avance je vous remercie beaucoup