Umair Shah Umair Shah - 6 months ago 74
jQuery Question

Add a JS and CSS code to Opencart header

I want to add the following CSS code to the header in 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; }


and also then the following code to the global body file in 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>


So how can I do it please?

Answer

You can add javascript and Css in header.tpl.

you can also refer below solutions:-

Adding a javascript to all pages in OpenCart