I fighting with a jquery script and I'm losing.
So I need some help.
What I want is to create a variable containing css setting
Then I want to use this variable in a jquery animate command:
I searched the internet and tried, tried and tried but .... without any luck.
This is what I tought would work (but isn't).
In smarty template I set a variable (stylecss_start) :
Code: Select all
{assign var="stylecss_start" value='opacity: 1'}
Code: Select all
var start_stylecss = {/literal}"{$stylecss_start}"{literal};
alert(start_stylecss);
Then I want to use this variable in the jquery animation :
Code: Select all
$(".myPopup").animate( start_stylecss );
Code: Select all
$(".myPopup").animate( { start_stylecss } );
$(".myPopup").animate( { + start_stylecss + } );
$(".myPopup").animate( "start_stylecss" );
The jquery is part of the tpl file so no extra jquery file to import.
Without the variable it is working
Code: Select all
$(".myPopup").animate( {opacity: 1});
