0

我想将以下 CSS 代码添加到 Opencart 的标题中:

/*=======================================================
MBL Page Peel PRO Effect For Blogger
=======================================================*/
.admin-bar #PagePeel{top:27px;}
/*Extra 20px height and width to allow for shadow and movement*/
#PagePeel{
height:120px;
overflow:hidden;
position:absolute;
right:0;
top:0;
width:120px;
z-index:9999;
}
#PagePeel svg{
overflow: hidden;
position: absolute !important;
right: 0;
top: 0;
}
#PagePeel .pointCursor:hover{cursor:pointer;}
#mycontent { position:relative; margin-left:30px; }

然后将以下代码添加到 Opencart 中的全局正文文件中:

<!--MBL Page Peel PRO Effect For Blogger-->
<script type='text/javascript' src='https://googledrive.com/host/0B0WJjcJEFNziazIzXzlhMlhtWlU'></script>
<script type='text/javascript' src='https://googledrive.com/host/0B0WJjcJEFNziMmk4anpFWnRPWHc'></script>
<script type='text/javascript' src='https://googledrive.com/host/0B0WJjcJEFNzidExmT1JpWV9xNmc'></script>
<div id="mycontent">Peel Away Effect By <a href="http://www.mybloggerlab.com">MyBloggerLab.com</a></div>
<script type='text/javascript'>
/* <![CDATA[ */
var PagePeelProParams = {"smallImageUrl":"http://3.bp.blogspot.com/-8R2exm5kGEs/UP1mU6NRXaI/AAAAAAAAMNw/ale8VHoC3Aw/s1600/DottedAdvertSmall.png","largeImageUrl":"http://3.bp.blogspot.com/-_8kUOwvbkak/UP1kHs-ODwI/AAAAAAAAMNg/04l7M_kMZAE/s1600/Temppeel.png","peelColorStart":"#545454","peelColorEnd":"#cdcdcf","pagePeelTargetUrl":"http://www.templateism.com","pagePeelActivateEvent":"hover"};
/* ]]> */
</script>

那么我该怎么做呢?

4

2 回答 2

2

包含 Css 文件代码:

$this->document->addStyle('catalog/view/theme/themename/stylesheet/product.css');

包含Js文件代码:

$this->document->addScript('catalog/view/theme/themename/js/product.js');

来源:http ://chandreshrana.blogspot.in/2017/02/how-to-add-css-and-js-file-in-head.html

于 2017-02-11T07:11:32.537 回答
0

您可以在header.tpl.

您也可以参考以下解决方案:-

向 OpenCart 中的所有页面添加 javascript

于 2013-09-29T08:51:14.113 回答