24-Nov-2011, 12:40 PM
Hello again
I face a very weird and perhaps, even very rare problem which I have absolutely no idea how to go about it.
the comment script - somehow - interferes with one specific js file I am using on some new pages. I have the comment script included on pages with dozens of more and MUCH more complicated javascript files and have absolutely NO problem, It just works as smooth as. That's why I am even greater baffled, because on the new pages I have hardly any .js files and the ones I use are rather very simple.
The following .js code is the one affected. The moment I place the comments onto the page, the organic tabs don't work any longer.
Please help me out of the mud thanks a lot
I face a very weird and perhaps, even very rare problem which I have absolutely no idea how to go about it.
the comment script - somehow - interferes with one specific js file I am using on some new pages. I have the comment script included on pages with dozens of more and MUCH more complicated javascript files and have absolutely NO problem, It just works as smooth as. That's why I am even greater baffled, because on the new pages I have hardly any .js files and the ones I use are rather very simple.
The following .js code is the one affected. The moment I place the comments onto the page, the organic tabs don't work any longer.
Please help me out of the mud thanks a lot
Code:
(function($) {
$.organicTabs = function(el, options) {
var base = this;
base.$el = $(el);
base.$nav = base.$el.find(".nav");
base.init = function() {
base.options = $.extend({},$.organicTabs.defaultOptions, options);
// Accessible hiding fix
$(".hide").css({
"position": "relative",
"top": 0,
"left": 0,
"display": "none"
});
base.$nav.delegate("li > a", "click", function() {
// Figure out current list via CSS class
var curList = base.$el.find("a.current").attr("href").substring(1),
// List moving to
$newList = $(this),
// Figure out ID of new list
listID = $newList.attr("href").substring(1),
// Set outer wrapper height to (static) height of current inner list
$allListWrap = base.$el.find(".list-wrap"),
curListHeight = $allListWrap.height();
$allListWrap.height(curListHeight);
if ((listID != curList) && ( base.$el.find(":animated").length == 0)) {
// Fade out current list
base.$el.find("#"+curList).fadeOut(base.options.speed, function() {
// Fade in new list on callback
base.$el.find("#"+listID).fadeIn(base.options.speed);
// Adjust outer wrapper to fit new list snuggly
var newHeight = base.$el.find("#"+listID).height();
$allListWrap.animate({
height: newHeight
});
// Remove highlighting - Add to just-clicked tab
base.$el.find(".nav li a").removeClass("current");
$newList.addClass("current");
});
}
// Don't behave like a regular link
// Stop propegation and bubbling
return false;
});
};
base.init();
};
$.organicTabs.defaultOptions = {
"speed": 300
};
$.fn.organicTabs = function(options) {
return this.each(function() {
(new $.organicTabs(this, options));
});
};
})(jQuery);