How to make 2 jQuery functions work? -


i have 2 jquery functions on website: fotoslider , scrollit function. can use 1 function because other won't work. depends on 1 put @ bottom.

i have barely knowledge jquery need functions on site.

the function working here fotoslider because it's @ bottom.

html:

<link href="ppgallery/css/ppgallery.css" rel="stylesheet" type="text/css" /> <link href="ppgallery/css/dark-hive/jquery-ui-1.8.6.custom.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script>  <script type="text/javascript" src="ppgallery/js/ppgallery.js"></script>  <script type="text/javascript"> $(document).ready(function() {     $('#gallery').ppgallery(); }); 

the script file scrollit function:

$(function(){   $.scrollit(); });  $(document).ready(function() {       var stickynavtop = $('#menu').offset().top;        var stickynav = function(){           var scrolltop = $(window).scrolltop();            if (scrolltop > stickynavtop) {                $('#menu').addclass('sticky');           } else {               $('#menu').removeclass('sticky');            }       };        stickynav();        $(window).scroll(function() {           stickynav();       });   });   

ps: fotoslider plugin

use jquery no-conflict

var $j = jquery.noconflict(); 

now can use $j instead of $ in jquery code.

there chances of conflict between these javascript libraries.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -