2013年9月3日 星期二

html-iframe-fire-parent scroll y only




a record click to change iFrame 

<p>Click on link bellow to change iframe content:</p>
<a href="http://www.bing.com" target="search_iframe">Bing</a> -
<a href="http://en.wikipedia.net" target="search_iframe">Wikipedia</a> -
<a href="http://google.com" target="search_iframe">Google</a> (not allowed in inframe)

<iframe src="http://en.wikipedia.net" width="100%" height="100%" name="search_iframe"></iframe>
*
iframe-scroll-y only


iframe{ width:500px; height: 500px; overflow-x: hidden; overflow-y: scroll }
<iframe  scrolling="no" height="400" width="600" >
<div id="addcontent" style='width:600px;overflow-y:scroll;overflow-x:hidden;height:400px;position:relative;top:0px;left:0px;'>
</div>
</iframe>


iframe-call-parent-event
sub-form-call-parent-form

inf : http://www.roseindia.net/java/pass-value-example/pass-value-from-iframe-parent.shtml


<~!--inputForm.html--(sub form)>
<html>
<head>
<title>IFrame Example</title>
</head>
<body>
<form name="frm2" >
<h1><font color="#000099">Input Form</font></h1>
<p>Name : </p><input type="text" name="resp" id="input" value=""/>
<input type="button" onclick="parent.hello(this.form.resp.value);" value="Submit" />
</form>
</body>


<!--PassValueIFrame.html--(main form)>
<html>
 <head>
  <title>IFrame Example</title>
  <script language="javascript">
function hello(string){
var name=string
document.getElementById('myAnchor').value=name;
}
 </script>
</head>
 <body>
  <iframe namne="iframe" id="iframe_id" src="inputForm.html" height="150" >
</iframe>
Name: <input type="text"  id="myAnchor" >
 </body>
</html>

沒有留言:

張貼留言