Не работает переход по ссылке

(Ответов: 0, Просмотров: 1955)
  1. Опытный
    • Регистрация: 06.08.2013
    • Сообщений: 307
    • Репутация: 5
    Ссылка есть, а переход по ссылке при щелчке левой кнопки мыши не осуществляется. А если открыть ссылку правой клавишей в новом окне открывается. Вот скрин Нажмите на изображение для увеличения.  Название:	??????.jpg  Просмотров:	4  Размер:	99.3 Кб  ID:	13296
    Сайт http://fr3809bb.bget.ru/ Вверху слайдер и там не работают ссылки.
    Оказалось это из-за файла js для этого слайдера. Но как там изменить, чтобы переход был я не знаю. Вот код:
    PHP код:
    (function( window, $, undefined ) {
        
        
    // http://www.netcu.de/jquery-touchwipe-iphone-ipad-library
        
    $.fn.touchwipe                 = function(settings) {
            
            var 
    config = {
                
    min_move_x20,
                
    min_move_y20,
                
    wipeLeft: function() { },
                
    wipeRight: function() { },
                
    wipeUp: function() { },
                
    wipeDown: function() { },
                
    preventDefaultEventstrue
            
    };
         
            if (
    settings) $.extend(configsettings);
     
            
    this.each(function() {
                var 
    startX;
                var 
    startY;
                var 
    isMoving false;

                function 
    cancelTouch() {
                    
    this.removeEventListener('touchmove'onTouchMove);
                    
    startX null;
                    
    isMoving false;
                }    
             
                function 
    onTouchMove(e) {
                    if(
    config.preventDefaultEvents) {
                        
    e.preventDefault();
                    }
                    if(
    isMoving) {
                        var 
    e.touches[0].pageX;
                        var 
    e.touches[0].pageY;
                        var 
    dx startX x;
                        var 
    dy startY y;
                        if(
    Math.abs(dx) >= config.min_move_x) {
                            
    cancelTouch();
                            if(
    dx 0) {
                                
    config.wipeLeft();
                            }
                            else {
                                
    config.wipeRight();
                            }
                        }
                        else if(
    Math.abs(dy) >= config.min_move_y) {
                            
    cancelTouch();
                            if(
    dy 0) {
                                
    config.wipeDown();
                            }
                            else {
                                
    config.wipeUp();
                            }
                        }
                    }
                }
             
                function 
    onTouchStart(e)
                {
                    if (
    e.touches.length == 1) {
                        
    startX e.touches[0].pageX;
                        
    startY e.touches[0].pageY;
                        
    isMoving true;
                        
    this.addEventListener('touchmove'onTouchMovefalse);
                    }
                }         
                if (
    'ontouchstart' in document.documentElement) {
                    
    this.addEventListener('touchstart'onTouchStartfalse);
                }
            });
     
            return 
    this;
        };
        
        $.
    elastislide                 = function( optionselement ) {
            
    this.$el    = $( element );
            
    this._initoptions );
        };
        
        $.
    elastislide.defaults         = {
            
    speed        450,    // animation speed
            
    easing        '',    // animation easing effect
            
    imageW        190,    // the images width
            
    margin        3,    // image margin right
            
    border        2,    // image border
            
    minItems    1,    // the minimum number of items to show. 
                                // when we resize the window, this will make sure minItems are always shown 
                                // (unless of course minItems is higher than the total number of elements)
            
    current        0,    // index of the current item
                                // when we resize the window, the carousel will make sure this item is visible 
            
    onClick        : function() { return true; } // click item callback
        
    };
        
        $.
    elastislide.prototype     = {
            
    _init                 : function( options ) {
                
                
    this.options         = $.extendtrue, {}, $.elastislide.defaultsoptions );
                
                
    // <ul>
                
    this.$slider        this.$el.find('ul');
                
                
    // <li>
                
    this.$items            this.$slider.children('li');
                
                
    // total number of elements / images
                
    this.itemsCount        this.$items.length;
                
                
    // cache the <ul>'s parent, since we will eventually need to recalculate its width on window resize
                
    this.$esCarousel    this.$slider.parent();
                
                
    // validate options
                
    this._validateOptions();
                
                
    // set sizes and initialize some vars...
                
    this._configure();
                
                
    // add navigation buttons
                
    this._addControls();
                
                
    // initialize the events
                
    this._initEvents();
                
                
    // show the <ul>
                
    this.$slider.show();
                
                
    // slide to current's position
                
    this._slideToCurrentfalse );
                
            },
            
    _validateOptions    : function() {
            
                if( 
    this.options.speed )
                    
    this.options.speed 450;
                if( 
    this.options.margin )
                    
    this.options.margin 4;
                if( 
    this.options.border )
                    
    this.options.border 1;
                if( 
    this.options.minItems || this.options.minItems this.itemsCount )
                    
    this.options.minItems 1;
                if( 
    this.options.current this.itemsCount )
                    
    this.options.current 0;
                    
            },
            
    _configure            : function() {
                
                
    // current item's index
                
    this.current        this.options.current;
                
                
    // the ul's parent's (div.es-carousel) width is the "visible" width
                
    this.visibleWidth    this.$esCarousel.width();
                
                
    // test to see if we need to initially resize the items
                
    if( this.visibleWidth this.options.minItems * ( this.options.imageW this.options.border ) + ( this.options.minItems ) * this.options.margin ) {
                    
    this._setDim( ( this.visibleWidth - ( this.options.minItems ) * this.options.margin ) / this.options.minItems );
                    
    this._setCurrentValues();
                    
    // how many items fit with the current width
                    
    this.fitCount    this.options.minItems;
                }
                else {
                    
    this._setDim();
                    
    this._setCurrentValues();
                }
                
                
    // set the <ul> width
                
    this.$slider.css({
                    
    width    this.sliderW
                
    });
                
            },
            
    _setDim                : function( elW ) {
                
                
    // <li> style
                
    this.$items.css({
                    
    marginRight    this.options.margin,
                    
    width        : ( elW ) ? elW this.options.imageW this.options.border
                
    }).children('a').css({ // <a> style
                    
    borderWidth        this.options.border
                
    });
                
            },
            
    _setCurrentValues    : function() {
                
                
    // the total space occupied by one item
                
    this.itemW            this.$items.outerWidth(true);
                
                
    // total width of the slider / <ul>
                // this will eventually change on window resize
                
    this.sliderW        this.itemW this.itemsCount;
                
                
    // the ul parent's (div.es-carousel) width is the "visible" width
                
    this.visibleWidth    this.$esCarousel.width();
                
                
    // how many items fit with the current width
                
    this.fitCount        Math.floorthis.visibleWidth this.itemW );
                
            },
            
    _addControls        : function() {
                
                
    this.$navNext    = $('<span class="es-nav-next">Next</span>');
                
    this.$navPrev    = $('<span class="es-nav-prev">Previous</span>');
                $(
    '<div class="es-nav"/>')
                .
    appendthis.$navPrev )
                .
    appendthis.$navNext )
                .
    appendTothis.$el );
                
                
    //this._toggleControls();
                    
            
    },
            
    _toggleControls        : function( dirstatus ) {
                
                
    // show / hide navigation buttons
                
    if( dir && status ) {
                    if( 
    status === )
                        ( 
    dir === 'right' ) ? this.$navNext.show() : this.$navPrev.show();
                    else
                        ( 
    dir === 'right' ) ? this.$navNext.hide() : this.$navPrev.hide();
                }
                else if( 
    this.current === this.itemsCount || this.fitCount >= this.itemsCount )
                        
    this.$navNext.hide();
                
            },
            
    _initEvents            : function() {
                
                var 
    instance    this;
                
                
    // window resize
                
    $(window).bind('resize.elastislide', function( event ) {
                    
                    
    // set values again
                    
    instance._setCurrentValues();
                    
                    
    // need to resize items
                    
    if( instance.visibleWidth instance.options.minItems * ( instance.options.imageW instance.options.border ) + ( instance.options.minItems ) * instance.options.margin ) {
                        
    instance._setDim( ( instance.visibleWidth - ( instance.options.minItems ) * instance.options.margin ) / instance.options.minItems );
                        
    instance._setCurrentValues();
                        
    instance.fitCount    instance.options.minItems;
                    }    
                    else{
                        
    instance._setDim();
                        
    instance._setCurrentValues();
                    }
                    
                    
    instance.$slider.css({
                        
    width    instance.sliderW 10 // TODO: +10px seems to solve a firefox "bug" :S
                    
    });
                            
                    
    // slide to the current element
                    
    clearTimeoutinstance.resetTimeout );
                    
    instance.resetTimeout    setTimeout(function() {
                        
    instance._slideToCurrent();
                    }, 
    200);
                    
                });
                
                
    // navigation buttons events
                
    this.$navNext.bind('click.elastislide', function( event ) {
                    
    instance._slide('right');
                });
                
                
    this.$navPrev.bind('click.elastislide', function( event ) {
                    
    instance._slide('left');
                });
                
                
    // item click event
                
    this.$items.bind('click.elastislide', function( event ) {
                    
    instance.options.onClick( $(this) );
                    return 
    false;
                });
                
                
    // touch events
                
    instance.$slider.touchwipe({
                    
    wipeLeft            : function() {
                        
    instance._slide('right');
                    },
                    
    wipeRight            : function() {
                        
    instance._slide('left');
                    }
                });
                
            },
            
    _slide                : function( dirvalanimcallback ) {
                
                
    // if animating return
                
    if( this.$slider.is(':animated') )
                    return 
    false;
                
                
    // current margin left
                
    var ml        parseFloatthis.$slider.css('margin-left') );
                
                
    // val is just passed when we want an exact value for the margin left (used in the _slideToCurrent function)
                
    if( val === undefined ) {
                
                    
    // how much to slide?
                    
    var amount    this.fitCount this.itemWval;
                    
                    if( 
    amount ) return false;
                    
                    
    // make sure not to leave a space between the last item / first item and the end / beggining of the slider available width
                    
    if( dir === 'right' && this.sliderW - ( Math.absml ) + amount ) < this.visibleWidth ) {
                        
    amount    this.sliderW - ( Math.absml ) + this.visibleWidth ) - this.options.margin// decrease the margin left
                        // show / hide navigation buttons
                        
    this._toggleControls'right', -);
                        
    this._toggleControls'left');
                    }
                    else if( 
    dir === 'left' && Math.absml ) - amount ) {                
                        
    amount    Math.absml );
                        
    // show / hide navigation buttons
                        
    this._toggleControls'left', -);
                        
    this._toggleControls'right');
                    }
                    else {
                        var 
    fml// future margin left
                        
    dir === 'right' 
                            ? 
    fml Math.absml ) + this.options.margin Math.absamount 
                            : 
    fml Math.absml ) - this.options.margin Math.absamount );
                        
                        
    // show / hide navigation buttons
                        
    if( fml )
                            
    this._toggleControls'left');
                        else    
                            
    this._toggleControls'left', -);
                        
                        if( 
    fml this.sliderW this.visibleWidth )
                            
    this._toggleControls'right');
                        else    
                            
    this._toggleControls'right', -);
                            
                    }
                    
                    ( 
    dir === 'right' ) ? val '-=' amount val '+=' amount
                    
                
    }
                else {
                    var 
    fml        Math.absval ); // future margin left
                    
                    
    if( Math.maxthis.sliderWthis.visibleWidth ) - fml this.visibleWidth ) {
                        
    val    = - ( Math.maxthis.sliderWthis.visibleWidth ) - this.visibleWidth );
                        if( 
    val !== )
                            
    val += this.options.margin;    // decrease the margin left if not on the first position
                            
                        // show / hide navigation buttons
                        
    this._toggleControls'right', -);
                        
    fml    Math.absval );
                    }
                    
                    
    // show / hide navigation buttons
                    
    if( fml )
                        
    this._toggleControls'left');
                    else
                        
    this._toggleControls'left', -);
                    
                    if( 
    Math.maxthis.sliderWthis.visibleWidth ) - this.visibleWidth fml this.options.margin )    
                        
    this._toggleControls'right');
                    else
                        
    this._toggleControls'right', -);
                        
                }
                
                $.
    fn.applyStyle = ( anim === undefined ) ? $.fn.animate : $.fn.css;
                
                var 
    sliderCSS    = { marginLeft val };
                
                var 
    instance    this;
                
                
    this.$slider.applyStylesliderCSS, $.extendtrue, [], { duration this.options.speedeasing this.options.easingcomplete : function() {
                    if( 
    callback callback.call();
                } } ) );
                
            },
            
    _slideToCurrent        : function( anim ) {
                
                
    // how much to slide?
                
    var amount    this.current this.itemW;
                
    this._slide('', -amountanim );
                
            },
            
    add                    : function( $newelemscallback ) {
                
                
    // adds new items to the carousel
                
    this.$items         this.$items.add$newelems );
                
    this.itemsCount        this.$items.length;
                
    this._setDim();
                
    this._setCurrentValues();
                
    this.$slider.css({
                    
    width    this.sliderW
                
    });
                
    this._slideToCurrent();
                
                if ( 
    callback callback.call$newelems );
                
            },
            
    destroy                : function( callback ) {
                
    this._destroycallback );
            },
            
    _destroy             : function( callback ) {
                
    this.$el.unbind('.elastislide').removeData('elastislide');
                $(
    window).unbind('.elastislide');
                if ( 
    callback callback.call();
            }
        };
        
        var 
    logError                 = function( message ) {
            if ( 
    this.console ) {
                
    console.errormessage );
            }
        };
        
        $.
    fn.elastislide                 = function( options ) {
            if ( 
    typeof options === 'string' ) {
                var 
    args = Array.prototype.slice.callarguments);

                
    this.each(function() {
                    var 
    instance = $.datathis'elastislide' );
                    if ( !
    instance ) {
                        
    logError"cannot call methods on elastislide prior to initialization; " +
                        
    "attempted to call method '" options "'" );
                        return;
                    }
                    if ( !$.
    isFunctioninstance[options] ) || options.charAt(0) === "_" ) {
                        
    logError"no such method '" options "' for elastislide instance" );
                        return;
                    }
                    
    instanceoptions ].applyinstanceargs );
                });
            } 
            else {
                
    this.each(function() {
                    var 
    instance = $.datathis'elastislide' );
                    if ( !
    instance ) {
                        $.
    datathis'elastislide', new $.elastislideoptionsthis ) );
                    }
                });
            }
            return 
    this;
        };
        
    })( 
    windowjQuery ); 
    Последний раз редактировалось SergeyNetIt; 14.01.2014 в 17:05.
    • 0

Похожие темы

Темы Раздел Ответов Последний пост
Xrumer со скидкой по реф-ссылке
Софт, скрипты, лицензии 7 12.11.2015 05:42
Регистрация по реферальной ссылке
Вопросы от новичков 10 10.07.2013 15:02
Как организовать автоматический переход по ссылке при открытии страницы
Web программирование 8 22.05.2013 15:27
Переход по ссылке на поисковый запрос - пллохо ли это?
Вопросы от новичков 2 05.10.2012 02:40
DLE и ID в ссылке
DLE 7 10.11.2011 13:55

У кого попросить инвайт?

Вы можете попросить инвайт у любого модератора:

Информеры