如何设置iframe的属性,在另一个页面中使用 [英] How to set attribute of iframe, which is used in another page
问题描述
你好朋友,
首先对不起,如果我问愚蠢的问题。我正在开发基于HTML5的应用程序,其中我使用iFrame在另一个页面中播放声音。现在我想设置Iframes的属性。该怎么做
default.html
< iframe src =bhMusic.htmlstyle =display:none;>< / iframe>
在bhMusic.html中,我正在播放声音。现在我想停止那种音乐。我该怎么做请帮帮我。
谢谢你的支持
更新的问题
首先,感谢大家表现出兴趣。好的,这是我的代码HTML页面,其中iFrame用于播放声音
default.html
Hello friends,
First sorry if I ask silly question. I am developing HTML5 based application in which I have used iFrame to play sound in another page. Now I want to set attribute of Iframes. how to do so
default.html
<iframe src="bhMusic.html" style="display:none;"></iframe>
In bhMusic.html I am playing sound. Now I want to stop that music. How would I do that. Please help me.
Thank you in adnvance
Updated Question
First thank you all for showing interest. Okay here is my code HTML page where iFrame is used to play sound
default.html
<html>
<head>
<link href="/css/default.css" rel="stylesheet" />
<script src="/js/default.js"></script>
</head>
<body>
<iframe src="bhMusic.html" style="display:none;"></iframe>
</body>
</html>
注意:显示:无
bhMusic.html
Note: display:none
bhMusic.html
<html>
<head>
</head>
<body>
<audio src="/sounds/preview-scrap.mp3" controls="controls" autoplay="" loop="" />
</body>
</html>
我在使用iframe时显示default.html。我不想显示那个iframe。现在,如果我想停止播放声音。我该怎么办?
谢谢。
I am showing default.html where Iframe is used. and I dont want to display that iframe. Now if I want to stop playing sound. what should I do?
Thank you.
推荐答案
如果你在<$ c中加载它$ c> iFrame ,然后页面就在那里。无需在iFrame
上执行任何操作。
您需要在html
页面本身,以便你可以停止声音。
显示一些按钮,这将停止音乐。您可以在iFrame
中看到它,因为它被添加到html
页面。
概念是iFrame
将显示源文件的每个内容,在您的情况下是html
file。
所以,如果你要在html中添加功能
,那肯定会显示在iFrame
里面,因为它只是一个容器
或窗口
显示页面。
希望你理解...... :)
If you are loading it iniFrame
, then the page is there. No need to do anything on theiFrame
.
You need to do some functionality inhtml
page itself, so that you can stop the sound.
Show some button, which will stop the music. And you can see that in theiFrame
itself, as it is added tohtml
page.
The concept is theiFrame
will show each and every content of the source file, in your case that is thehtml
file.
So, if you will add the functionality inhtml
, then that will definitely show inside theiFrame
, as it is just acontainer
orwindow
which is showing the page.
Hope you understand... :)
首先谢谢你们都表现出了兴趣。好的,这是我的代码
HTML页面,其中iFrame用于播放声音
default.html
First thank you all for showing interest. Okay here is my code
HTML page where iFrame is used to play sound
default.html
<html>
<head>
<link href="/css/default.css" rel="stylesheet" />
<script src="/js/default.js"></script>
</head>
<body>
<iframe src="bhMusic.html" style="display:none;"></iframe>
</body>
</html>
注意:显示:无
bhMusic.html
Note: display:none
bhMusic.html
<html>
<head>
</head>
<body>
<audio src="/sounds/preview-scrap.mp3" controls="controls" autoplay="" loop="" />
</body>
</html>
我在使用iframe时显示default.html。我不想显示那个iframe。现在,如果我想停止播放声音。我该怎么办?
谢谢。
I am showing default.html where Iframe is used. and I dont want to display that iframe. Now if I want to stop playing sound. what should I do?
Thank you.
这篇关于如何设置iframe的属性,在另一个页面中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!