Jquery and Regular Javascript Interference -
im building site in joomla , purchased content slider built in plain old javascript, built content boxes have animation on them provided jquery. right animations work, slider doesn't. wondering how page work using both. here's code
<script src="http://code.jquery.com/jquery-1.4.4.js"></script> <script>jquery.noconflict(); $(document).ready(function() { //settings var opacity = 0.5, toopacity = 1, duration = 350; //set opacity asap , events $('.opacity').css('opacity',opacity).hover(function() { $(this).fadeto(duration,toopacity); }, function() { $(this).fadeto(duration,opacity); } ); }); </script>
try calling after libraries loaded:
jquery.noconflict();
also, try replacing jquery ready function this:
jquery(document).ready(function($){
this passes $ shortcut jquery code block, should still avoid conflicts outside it.
you can read on subject here in jquery docs.
Comments
Post a Comment