Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

add custom Javascript in my site

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #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
  #2  
Old 12-23-2009, 04:57 AM
  vasilis's Avatar 
vasilis vasilis is offline
 

X-Adept
  
Join Date: Feb 2009
Posts: 761
 

Default Re: add custom Javascript in my site

I guess, it is ok....
__________________
Vasilis Vrontisis
X-Cart Development, Maintenance & Customization
https://[URL="http://www.craftforweb.com"]craftforweb.com[/url]
vasilis@craftforweb.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:33 PM.

   

 
X-Cart forums © 2001-2020