View Single Post
  #1  
Old 11-27-2009, 02:18 PM
  vasilis's Avatar 
vasilis vasilis is offline
 

X-Adept
  
Join Date: Feb 2009
Posts: 761
 

Default add custom Javascript in my site

I want to add a Javascript photo gallery in some of my embedded static pages, and I want to use an external Javascript file. Is it ok to add the link to the external Javascript file, as well as some additional Javascript sentences and conditional IE css fixes in the \skin1\customer\meta.tpl file ?
I did it this way and the Gallery works ok (except when I am in Webmaster mode I get a smarty error:
Quote:
Error: Smarty error: [in customer/meta.tpl line 119]: syntax error: unrecognized tag: display: none; (Smarty_Compiler.class.php, line 446) in C:\wamp\www\zoom_serie\include\lib\smarty\Smarty.c lass.php on line 1092
but still the gallery effect works ok.

The lines I added to meta.tpl file are the following:

Code:
{* fix for Lightweight Image Gallery *} <script type="text/javascript">document.write("<style type='text/css'> #gallery { display: none; } </style>");</script> <script type="text/javascript" language="JavaScript 1.2" src="{$SkinDir}/vas_custom_js.js"></script> {* another fix for Lightweight Image Gallery *} <!--[if lt IE 6]><style media="screen,projection" type="text/css">#gallery { display: block; }</style><![endif]--> <!--[if lt IE 8]> <style media="screen,projection" type="text/css"> #jgal li { filter: alpha(opacity=50); } #jgal li.active, #jgal li:hover { filter: alpha(opacity=100); } </style> <![endif]-->

plus the main Gallery Javascript code in the external vas_custom_js.js file.
__________________
Vasilis Vrontisis
X-Cart Development, Maintenance & Customization
https://[URL="http://www.craftforweb.com"]craftforweb.com[/url]
vasilis@craftforweb.com
Reply With Quote