I am converting html5 to wordpress Theme. I want to use custom scroll for wordpress. The code
DEPENDENCIES It's a plugin for the jquery framework, you need to include jquery in your scripts.
I will use
<?php wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); ?>
Will it work just by that What about below code?
$(document).ready(
function() {
$("html").niceScroll();
}
);
EXAMPLES 1. Simple mode, it styles document scrollbar (html element prefered):
Where to enter this to make it work?
After enqueuing , do i need it again to add in header.php
Explanation will be helpful.
How to use this code?
var seq = 0;
$(document).ready(function() {
$("html").niceScroll({styler:"fb",cursorcolor:"#000"});
$("#mainlogo img").eq(1).hide();
function goSeq() {
var nxt = (seq+1)%2;
$("#mainlogo img").eq(seq).fadeIn(2000);
$("#mainlogo img").eq(nxt).fadeOut(2000);
seq = nxt;
setTimeout(goSeq,2500);
};
goSeq();
$(window).load(function(){
setTimeout(function(){
$("#gmbox div").animate({'top':60},1500,"easeOutElastic");
},1500);
});
function trackLink(link, category, action) {
try {
_gaq.push(['_trackEvent', 'tracklink' ,'click',link.href ]);
setTimeout('document.location = "' + link.href + '"', 100)
}catch(err){}
}
$('[rel="outbound"]').click(function(e){
try {
_gaq.push(['_trackEvent','outbound','click',this.href]);
}catch(err){}
});
});