This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

js script interference
#1

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 Huh 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);
Reply
#2

Hi,

I've taken a look at your JavaScript code and I can't see any obvious problem.

Your JavaScript code validates as XHTML, and the variables don't seem to be used by Commentics.

You could try temporarily disabling some of the features of Commentics which use JavaScript, such as the Scroll Reply feature (Layout -> Comments -> Replies), the Like/Dislike/Flag features (Layout -> Comments -> Enabled), to see whether that's the issue.

Also, in the Firefox browser, you can check the Error Console by going to Tools -> Web Developer -> Error Console.

Have you completed the interview?
Reply
#3

Hi Steven
Thanks for your reply.

I checked the error console and found 2 errors. One is referring to Mozilla itself so nothing to worry about this one. The other
Quote:Error: $("#sidemenuL_inner").organicTabs is not a function
refers to the short script that triggers the tab-function on the tab menu.
Code:
<script type='text/javascript'>
    $(function() {

        $("#sidemenuL_inner").organicTabs();
        
        $("#sidemenuL2_inner").organicTabs({
            "speed": 200
        });

    });
</script>
Which doesn't give me any clue why this should be an error. Besides, the same tab menu works on many other pages without any problems.

I went ahead and followed your hints and found, in the comments admin I need to disable 3 functions; "Like / Dislike / Flag" and then everything seems to work fine? Any idea how to work around this?

OH, this is referring to version 1.5!

Thanks for your help
Norbs

Reply
#4

I upgraded to version 1.7 and (at least on my local machine) it appears that the javascript interference had been solved.

All the styling was quickly replaced again - only one little hick-up which was present from the very beginning- I just can't make it out what this is and where it comes from;
  1. funny characters (top left corner in screen shot)
Thanks a lot


Attached Files Thumbnail(s)
   
Reply
#5

Fixed ... changed my CHARSET to utf-8 and that got rid of the characters!
THANKS
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post

Forum Jump:


Users browsing this thread: 1 Guest(s)