View Single Post
  #5  
Old 02-21-2014, 06:55 AM
  Petepots's Avatar 
Petepots Petepots is offline
 

eXpert
  
Join Date: Aug 2007
Location: Surrey, UK
Posts: 275
 

Default Re: Can anyone help in simple Javascript

Cherie

Still cant get this to work, let me explain

I have a varable called {$lng.txt_simpletext} and in there is says:
This is a simple extra
test

and the
$product.descr says:
This is the full description held in prod file



So I have to printout the description and as you can see it alows HTML code in it

<td class="descr">{eval var=$product.fulldescr|default:$product.descr}


Now this is where I cannot get it to work, I changed the "#" to javascript, still no luck. It look as if I am nearly there (see pic)

<a href="javascript:" onclick="toggle({$lng.txt_simpletext})">see more</a> <div id={$lng.txt_simpletext}> </div>

<script type="text/javascript">
function toggle(id) {
$("#"+id).toggle();
return false;
}
</script>

As you can see the {$lng.txt_simpletext} is coming out before I click the "see more"



http://kingquick.co.uk/peters_files/forum/java_problem/full_product2.jpg

Hope you can help, if you could cut and paste the javascript and fill it in where the varables should go, it would be a great help. I am very greatful for your help.

Kind regards

Peter
__________________
Version 4.7.2
Reply With Quote