gpt4 book ai didi

Javascript 函数可以正确播放旧网站,但不能正确播放新网站

转载 作者:行者123 更新时间:2023-12-02 17:52:54 24 4
gpt4 key购买 nike

我最近将公司网站移至我们未使用的 Web 服务器之一,以便将 Joomla 后端从 1.5.26 更新到最新的 Joomla 2.5。由于模块的原因,我们无法升级到 3.x。我使用了 SP Upgrade,一旦安装了新主题和当前模块,一切都顺利迁移。

我们有一个自定义的默认主题和一个分配给主页的主题。在分配的主题(分配给主菜单)目录中,index.php 在标题上方有一个脚本。我将在下面发布此代码。

可以通过以下链接找到旧网站,当您第一次访问该网站时,您将看到视频播放。cpmchurchministries.com/old

可以通过以下链接找到新网站,当您第一次访问该网站时,您只会看到一张图片。cpmchurchministries.com/new

两个站点的代码相同,index.php:

<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css"/>
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/swf/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("<?php echo $this->baseurl ?>/templates/chosenpeople/swf/cpm_logo.swf", "flash_logo", "245", "162", "7");
window.addEvent('domready', function() {
if($('default_header')) {
if(Cookie.get("cpm_movie") != "full") {
full_movie();
} else {
small_movie();
}
}
});

function small_movie() {
$('default_header').removeClass('full_movie');
$('default_header').addClass('small_movie');
swfobject.embedSWF("<?php echo $this->baseurl ?>/templates/cphome/swf/header_home.swf", "flash_header", "696", "157", "7");
}

function full_movie() {
$('default_header').removeClass('small_movie');
$('default_header').addClass('full_movie');
Cookie.set("cpm_movie", "full", {duration: 365});
swfobject.embedSWF("<?php echo $this->baseurl ?>/templates/cphome/swf/video_header.swf", "flash_header", "696", "400", "7");
}
</script>
<?php if ($editmode) echo '<link rel="stylesheet" href="'.$this->baseurl.'/templates/system/css/general.css" type="text/css" />'."\n"; ?>

有人遇到过类似的问题吗?可以获得任何帮助吗?谢谢。 。 .

最佳答案

您正在使用的较新版本的 Joomla 使用较新版本的 MooTools 库,因此您需要对代码进行以下两个功能更改:

<小时/>

window.addEvent('domready', function() {
if($('default_header')) {
if(Cookie.get("cpm_movie") != "full") {
full_movie();
} else {
small_movie();
}
}
});


function small_movie() {
$('default_header').removeClass('full_movie');
$('default_header').addClass('small_movie');
swfobject.embedSWF("/new/templates/cphome/swf/header_home.swf", "flash_header", "696", "157", "7");
}

function full_movie() {
$('default_header').removeClass('small_movie');
$('default_header').addClass('full_movie');
Cookie.set("cpm_movie", "full", {duration: 365});
swfobject.embedSWF("/new/templates/cphome/swf/video_header.swf", "flash_header", "696", "400", "7");
}
<小时/>

window.addEvent('domready', function() {    
if($('default_header')) {
if(Cookie.read("cpm_movie") != "full") {
full_movie();
} else {
small_movie();
}
}
});

function small_movie() {
$('default_header').removeClass('full_movie');
$('default_header').addClass('small_movie');
swfobject.embedSWF("/new/templates/cphome/swf/header_home.swf", "flash_header", "696", "157", "7");
}
function full_movie() {
$('default_header').removeClass('small_movie');
$('default_header').addClass('full_movie');
Cookie.write("cpm_movie", "full", {duration: 365});
swfobject.embedSWF("/new/templates/cphome/swf/video_header.swf", "flash_header", "696", "400", "7");
}

编辑以便轻松复制粘贴

关于Javascript 函数可以正确播放旧网站,但不能正确播放新网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21206344/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com