Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript DIV swap onclick_Javascript_Html - Fatal编程技术网

Javascript DIV swap onclick

Javascript DIV swap onclick,javascript,html,Javascript,Html,我目前正试图在我的网站上实现一个内容锁定系统,作为其中的一部分,我想锁定一个现场mp3播放器,直到用户完成报价 因此,当页面加载时,它会显示播放器,但如果他们试图点击它,它会弹出内容锁,一旦他们完成了一个报价,它就会将DIV交换给完全可用的播放器 代码如下: <div id="mobmp3"> <div id="yoursecDiv" style="display:block; z-index: 999;"> <a href="javascript:voi

我目前正试图在我的网站上实现一个内容锁定系统,作为其中的一部分,我想锁定一个现场mp3播放器,直到用户完成报价

因此,当页面加载时,它会显示播放器,但如果他们试图点击它,它会弹出内容锁,一旦他们完成了一个报价,它就会将DIV交换给完全可用的播放器

代码如下:

<div id="mobmp3">
    <div id="yoursecDiv" style="display:block; z-index: 999;">  <a href="javascript:void(0)" onclick="var fileref=document.createElement('script');fileref.setAttribute('type','text/javascript'); fileref.setAttribute('src', 'http://c.themixtapesite.com/locker.js?guid=0512eafd69b18d22');document.body.appendChild(fileref); setTimeout(yourFunction, 3000);"> 
                                            <iframe src="http://themixtapesite.com/wp-content/plugins/amazon-s3-cloud-mp3-player/html5/html5mob2.php?bucket=mixtape2" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" width="97.4%" height="280" max-width="97.4%">
                                            </iframe>
                                    </a>

    </div>
</div>
<!-- Place the Real Link within yourfirDiv which is set to not display
until yourFunction has been executed. -->
<div id="yourfirDiv" style="display:none;">
    <iframe src="http://themixtapesite.com/wp-content/plugins/amazon-s3-cloud-mp3-player/html5/html5mob2.php?bucket=mixtape2"
    frameborder="0" marginheight="0" marginwidth="0" scrolling="no" width="97.4%"
    height="280" max-width="97.4%"></iframe>
</div>  

因此,正如您所看到的,我正在尝试在
yoursecDiv
中加载一个iframe(播放器)。然后,一旦他们完成报价,它将重新加载
yourfirDiv
,这是同一个播放器,但没有内容储物柜

我希望通过将
包装在
标记中,我可以实现这一点,但是,唉,它不起作用

所以我想我的问题是:
有没有一种方法可以在iframe上覆盖一个div(或其他内容)作为打开content locker的链接?

现在解决了这个问题。。。呼吸了一点新鲜空气后,我的大脑开始工作,我只是用一个透明的gif覆盖在div上。然后将该gif设置为触发链接。

你不能显示一个div(储物柜),当你想启用它时,使用jQuery隐藏div并显示播放器?仅仅通过查看代码,这不是很容易做到的吗?对于那些对web开发稍有了解的人来说,这是非常容易做到的,也就是说,你可以打开firebug,找到div或透明gif或任何你的“内容拦截器”,然后删除元素。如果这不重要,你不介意像我们这样的一些人这样做,那么这就不是问题!