0

我已经购买了 Joomla 的扩展!来自 YouJoomla,由于他们的支持论坛是人类创造的最糟糕的东西,我想我会问你们。

我遇到的主要问题是 Fx 问题,或者可能是 javascript 冲突。

我试图通过一个名为 YJK2Slider 的插件将图像滑块添加到 Joomla 中的 K2 对象。我唯一要做的就是安装插件,激活它,它应该可以正常工作。是的,但没有。它卡在加载并渲染图像 0x0 像素。但是,当我删除控制台告诉我的代码是冲突时,它会加载图像并且我可以从左到右滚动,但我不能使用几乎是一个关键功能的缩略图。

这是滑块的完整 js 代码...

var YJK2SimpleSlide = new Class({
    Implements: [Options],
    options: {
            outerContainer: null,
            innerContainer: null,
            elements: null,
            navigation: {
                forward: null,
                back: null,
                container: null,
                elements: null,
                outer: null,
                visibleItems: 0
            },
            slideType: 0,
            orientation: 1,
            slideTime: 3000,
            duration: 600,
            tooltips: 0,
            autoslide: 1,
            navInfo: null,
            navLinks: null,
            startElem: null
        },

    initialize: function(options) {
        this.setOptions(options);       
        this.navElements = $(this.options.navigation.container).getElements(this.options.navigation.elements);
        this.navScroll = new Fx.Scroll(this.options.navigation.outer, {
            link: 'cancel',
            duration: 800,
            transition: Fx.Transitions.Quad.easeInOut
        });
        this.correction = Math.round(this.options.navigation.visibleItems / 2.00001);
        this.start()
    },

    start: function(){
        this.currentElement = this.options.startElem;   
        this.direction = 1; // -1: back; 1:forward
        this.elements = $(this.options.innerContainer).getElements(this.options.elements);

        this.showEffect = {};
        this.hideEffect = {};
        this.firstRun = {};

        if( this.options.slideType!==0 ){
            if( this.options.orientation == 1 ){
                this.showEffect.left = [1200,0];
                this.hideEffect.left = [0,1200];
                this.firstRun.left = 1200;
            }else{
                this.showEffect.top = [400,0];
                this.hideEffect.top = [0,400];
                this.firstRun.top = 400;
            }
        }
        if( this.options.slideType!==1 ){
            this.showEffect.opacity = [0,1];
            this.hideEffect.opacity = [1,0];
            this.firstRun.opacity = 0;
        }

var fadeSliderIn = new Fx.Morph(this.options.outerContainer, {
    duration: 3000,
    transition: Fx.Transitions.Sine.easeOut
});

fadeSliderIn.start({
    'visibility': 'visible',
    'opacity': [0.001, 1]
}); 
var fadeNavIn = new Fx.Morph(this.options.navigation.container, {
    duration: 3000,
    transition: Fx.Transitions.Sine.easeOut
}); 
fadeNavIn.start({
    'visibility': 'visible',
    'opacity': [0.001, 1]
}); 
        /* slides */
        this.elements.each( function(el, i){            

            el.setStyles({
                'display':'block',
                'position':'absolute',
                'top':0,
                'left':0,
                'z-index':(100-i)
            }); 

            if( this.options.slideType!==1 && i!==this.currentElement  )
                el.setStyle('opacity',0);

            this.elements[i]['fx'] = new Fx.Morph(el, {link:'cancel', duration: this.options.duration});

            if(i!==this.currentElement)
                this.elements[i]['fx'].set(this.firstRun);

            el.addEvent('mouseenter', function(event){
                //$clear(this.period);
                clearTimeout(this.period);
            }.bind(this));
            el.addEvent('mouseleave', function(event){
                if(this.options.autoslide==1){
                    this.resetAutoslide();
                }
            }.bind(this));

        }.bind(this));
        /* autoslide on command */
        if(this.options.autoslide == 1){
            this.period = this.rotateSlides.periodical(this.options.slideTime, this);
        }
        /* add navigation */
        this.setNavigation();

        if(this.options.navLinks){
            this.secondNavigation();
            $(this.options.navigation.container).addEvent('mousewheel', function(event){
                event = new Event(event);
                //event.stop();
                event.preventDefault();
                      var dir = event.wheel > 0 ? 1 : -1;
                      var el = this.currentElement - dir;
                //var el = this.currentElement-event.wheel;
                if( event.wheel > 0 && el < 0 ) el = this.navElements.length-1;
                if( event.wheel < 0 && el > this.navElements.length-1 ) el = 0;
                if( this.options.autoslide == 1 ){
                    //$clear(this.period);
                    clearTimeout(this.period);
                    this.resetAutoslide();
                }
                this.nextSlide(el);                 
            }.bind(this));  
        }
    },

    rotateSlides: function(){
        var next = this.currentElement+this.direction;
        if( next < 0 ) next = this.elements.length-1;
        if( next >  this.elements.length-1) next = 0;
        this.nextSlide(next);   
    },

    nextSlide: function(slide){
        if(slide==this.currentElement) return;
        this.elements[this.currentElement]['fx'].start(this.hideEffect);
        this.elements[slide]['fx'].start(this.showEffect);

        this.currentElement = slide;

        if($(this.options.navInfo)){
            $(this.options.navInfo).setHTML('Link '+(slide+1)+' of '+this.elements.length);
        }

        //if($defined(this.navElements)){
        if(this.navElements !== undefined && this.navElements !== null){            
            this.navElements.removeClass('selected');
            this.navElements[slide].addClass('selected');

            /* slide to element */
            var navTo = slide-this.correction < 0 ? 0 : slide-this.correction;  
            if( navTo+this.correction >= this.navElements.length-this.correction ) navTo = (this.navElements.length-1) - this.correction*2;
            this.navScroll.toElement(this.navElements[navTo]);

        }

    },

    setNavigation: function(){
        if(!$(this.options.navigation.forward)) return;

        $(this.options.navigation.forward).addEvent('click', function(event){
            //new Event(event).stop();
            event.preventDefault();
            this.direction = 1;
            if (this.options.autoslide == 1) {
                this.resetAutoslide();  
            }
            this.rotateSlides();
        }.bind(this));

        $(this.options.navigation.back).addEvent('click', function(event){
            //new Event(event).stop();
            event.preventDefault();
            this.direction = -1;
            if (this.options.autoslide == 1) {
                this.resetAutoslide();
            }
            this.rotateSlides();
        }.bind(this));

    },

    resetAutoslide: function(){
        //$clear(this.period);
        clearTimeout(this.period);
        this.period = this.rotateSlides.periodical(this.options.slideTime, this);       
    },

    secondNavigation: function(){
        this.navElements = $$(this.options.navLinks);
        this.navElements.each(function(el,i){

            if( i == this.currentElement ){
                this.navScroll.toElement(el);
                el.addClass('selected');
            }

            el.addEvent('click', function(event){
                //new Event(event).stop();
                event.preventDefault();
                this.resetAutoslide();
                this.nextSlide(i);              
            }.bind(this));

        }.bind(this));

    }
});

window.addEvent('domready', function() {
   $$('#SimpleSlide_outer').setStyles({
       boxShadow: '0px 0px 3px 1px #d8d8d8',
       WebkitBoxShadow:'0px 0px 3px 1px #d8d8d8',
       MozBoxShadow:'0px 0px 3px 1px #d8d8d8'
    });
});

...这是搞砸的部分。

this.navScroll = new Fx.Scroll(this.options.navigation.outer, {
            link: 'cancel',
            duration: 800,
            transition: Fx.Transitions.Quad.easeInOut
        });

这是我要放置滑块的链接;http://dev9.hosterspace.com/pyramiden/index.php/projekt/utbildning/item/4-campus-varberg 这里是开发者演示网站;http://extensions.youjoomla.info/yj-k2-image-slider.html

谁能帮我?:)

4

1 回答 1

0

问题是我的 Joomla!安装不包括 mootools-more.js,默认情况下应该包括在内。当我添加它时,一切都很顺利!

于 2013-05-03T09:48:23.367 回答