Jump to content

[SOLVED] Adding jquery for an animation in header.tlp SOLVED


Mark Agency

Recommended Posts

H, actually I'm trying to insert jquery code in header.tlp but when I put it into head tags and reload I got a blank page, please help me, above the code.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<script> 
$(document).ready(function(){
  $("shopping_cart").hover(function(){
    $("cart_block").animate({top:'50px'});
    $("cart_block").show();
}, function() {
    $("cart_block").animate({bottom:'50px'});
    $("cart_block").hide();  
$("cart_block").hover(function(){
    $("cart_block").show();
}, function() {
    $("cart_block").hide();
});
});
});
</script> 
Edited by vekia (see edit history)
Link to comment
Share on other sites

 

your script uses brackets, you have to use {literal}{/literal} tags, because of brackets compiler thinks that this is smarty syntax - in fact, it isn't.

{literal}
SCRIPT HERE
{/literal}

Thanks for you answer.

 

I've done like this and did not work, instead y used like I posted and check console errors, put the .js files on the correct folder and it worked.

 

Thanks 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...