I think my problem is very small, but i still need for help in my jquery code, I think it’s all about js syntax:
$(function() {
// Options for SuperBGImage
$.fn.superbgimage.options = {
randomtransition: 2, // 0-none, 1-use random transition (0-7)
z_index: -1, // z-index for the container
slideshow: 1, // 0-none, 1-autostart slideshow
slide_interval: 2000, // interval for the slideshow
randomimage: 1, // 0-none, 1-random image
speed: 'slow' // animation speed
};
// initialize SuperBGImage
$('#thumbs').superbgimage().hide();
});
$(function() {
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j('.menu-nav li').hover(
function() {
$j(this).addClass("active");
$j(this).find('.ulwrapper').stop(false, true).fadeIn();
$j(this).find('.ulwrapper .ulwrapper').stop(false, true).fadeOut('fast');
},
function() {
$j(this).removeClass("active");
$j(this).find('div').stop(false, true).fadeOut('fast');
}
);
$j('.ulwrapper').hover(
function() {
$j('.parent').addClass("active_tab");
},
function() {
$j('.parent').removeClass("active_tab");
}
);
});
});
the first code is for the Big image where the other is to work with my multi-level menu. I tried to workaround this by changing
$(function() {
to
$j(document).ready(function(){
but the browser only runs one code! and gives me:
Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function
(anonymous function)
I am waiting your help, thanks too much.
Once you call jQuery.noConflict, the “$” binding won’t work anymore. You don’t say why you’re calling it, but you can use just “jQuery” instead of “$”. Your “$j” variable is local to that function where you call “noConflict”.
Also, it doesn’t make sense to do this:
which is what you’re doing in that second “ready” handler. That is, you’re setting up a “ready” handler from inside another one, which makes no sense really.