如何设置iframe的属性,在另一个页面中使用 [英] How to set attribute of iframe, which is used in another page

查看:79
本文介绍了如何设置iframe的属性,在另一个页面中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

首先对不起,如果我问愚蠢的问题。我正在开发基于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 in iFrame, then the page is there. No need to do anything on the iFrame.

You need to do some functionality in html page itself, so that you can stop the sound.
Show some button, which will stop the music. And you can see that in the iFrame itself, as it is added to html page.

The concept is the iFrame will show each and every content of the source file, in your case that is the html file.

So, if you will add the functionality in html, then that will definitely show inside the iFrame, as it is just a container or window 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆