10-07-2009, 06:52 PM
|
#1 (permalink)
|
|
The Acquainted
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
|
Best way to echo some js
I have an if statement that will echo some javascript if certain things are true.
I'm currently writing it as:
PHP Code:
<?php if($x=1){ ?> <script type="text/javascript"> $(document).ready(function(){ $('.boxgrid.captionfull').hover(function(){ $(".cover", this).stop().animate({top:'30px'},{queue:false,duration:160}); }, function() { $(".cover", this).stop().animate({top:'150px'},{queue:false,duration:160}); }); }); </script> <?php } ?>
Obviously that's not my real if, it's just to give you an idea.
I'm sure there must be a better way to do it than this?
|
|
|