Показать сообщение отдельно
  #4 (permalink)  
Старый 08.09.2014, 17:03
Аспирант
Отправить личное сообщение для DDSSDD Посмотреть профиль Найти все сообщения от DDSSDD
 
Регистрация: 06.04.2011
Сообщений: 53

Урряяя! Заработалао! Блин 1.5 дня, что бы из скрипта убрать position:relative родителю......... ПРЕМИЮ ДАРВИНА В СТУДИЮ!

/**
  * Rhinoslider 1.05
  * [url]http://rhinoslider.com/[/url]
  *
  * Copyright 2012: Sebastian Pontow, Rene Maas ([url]http://renemaas.de/[/url])
  * Dual licensed under the MIT or GPL Version 2 licenses.
  * [url]http://rhinoslider.com/license/[/url]
  */
(function($,window,undefined){
    $.extend($.easing,{
        def:'out',
        out:function(none,currentTime,startValue,endValue,totalTime){
            return-endValue*(currentTime/=totalTime)*(currentTime-2)+startValue;
        },
        kick:function(none,currentTime,startValue,endValue,totalTime){
            if((currentTime/=totalTime/2)<1){
                return endValue/2*Math.pow(2,10*(currentTime-1))+startValue;
            }
            return endValue/2*(-Math.pow(2,-10*--currentTime)+2)+startValue;
        },
        shuffle:function(none,currentTime,startValue,endValue,totalTime){
            if((currentTime/=totalTime/2)<1){
                return endValue/2*currentTime*currentTime*currentTime*currentTime*currentTime+startValue;
            }
            return endValue/2*((currentTime-=2)*currentTime*currentTime*currentTime*currentTime+2)+startValue;
        }
    });
    var rhinoSlider=function(element,opts){
        var
        settings=$.extend({},$.fn.rhinoslider.defaults,opts),$slider=$(element),effects=$.fn.rhinoslider.effects,preparations=$.fn.rhinoslider.preparations,vars={
            isPlaying:false,
            intervalAutoPlay:false,
            active:'',
            next:'',
            container:'',
            items:'',
            buttons:[],
            prefix:'rhino-',
            playedArray:[],
            playedCounter:0,
            original:element
        };
    
        settings.callBeforeInit();
        var
        setUpSettings=function(settings){
            settings.controlsPrevNext=String(settings.controlsPrevNext)=='true'?true:false;
            settings.controlsKeyboard=String(settings.controlsKeyboard)=='true'?true:false;
            settings.controlsMousewheel=String(settings.controlsMousewheel)=='true'?true:false;
            settings.controlsPlayPause=String(settings.controlsPlayPause)=='true'?true:false;
            settings.pauseOnHover=String(settings.pauseOnHover)=='true'?true:false;
            settings.animateActive=String(settings.animateActive)=='true'?true:false;
            settings.autoPlay=String(settings.autoPlay)=='true'?true:false;
            settings.cycled=String(settings.cycled)=='true'?true:false;
            settings.showTime=parseInt(settings.showTime,10);
            settings.effectTime=parseInt(settings.effectTime,10);
            settings.controlFadeTime=parseInt(settings.controlFadeTime,10);
            settings.captionsFadeTime=parseInt(settings.captionsFadeTime,10);
            tmpShiftValue=settings.shiftValue;
            tmpParts=settings.parts;
            settings.shiftValue=[];
            settings.parts=[];
            return settings;
        },init=function($slider,settings,vars){
            settings=setUpSettings(settings);
            $slider.wrap('<div class="'+vars.prefix+'container">');
            vars.container=$slider.parent('.'+vars.prefix+'container');
            vars.isPlaying=settings.autoPlay;
            var buttons='';
            if(settings.controlsPrevNext){
                vars.container.addClass(vars.prefix+'controls-prev-next');
                
                
                buttons='<a class="'+vars.prefix+'prev '+vars.prefix+'btn">'+settings.prevText+'</a><a class="'
                +vars.prefix+'next '+vars.prefix+'btn">'+settings.nextText+'</a>';
                vars.container.append(buttons);
                vars.buttons.prev=vars.container.find('.'+vars.prefix+'prev');
                vars.buttons.next=vars.container.find('.'+vars.prefix+'next');
                vars.buttons.prev.click(function(){


                    $(".rhino-next").hide();
                    $('.form-submit').show();
                    $('.form-submit').html("Äàëåå");
                    
                    if(($slider.find('.rhino-active').index()) != 0){
                        
                        prev($slider,settings);
                    }
                    if($slider.find('.rhino-active').index() == 1){
                        $(".rhino-prev").hide();
                    }
                    
                    
                    if(settings.autoPlay){
                        pause();
                    }
                });
                vars.buttons.next.click(function(){
                    $(".rhino-next").hide();
                    $('.form-submit').show();
                    $(".rhino-prev").show();
                    
                    if($slider.find('.rhino-active').index() != ($slider.find('.rhino-item').length -1)){
                        next($slider,settings);
                    }
                    if($slider.find('.rhino-active').index() == ($slider.find('.rhino-item').length -2)){
                        $('.form-submit').html("Ðàññ÷èòàòü");

                    }

                    if(settings.autoPlay){
                        pause();
                    }
                });
            }
            if(settings.controlsPlayPause){
                vars.container.addClass(vars.prefix+'controls-play-pause');
                buttons=settings.autoPlay?'<a class="'+vars.prefix+'toggle '+vars.prefix+'pause '+vars.prefix+'btn">'+settings.pauseText+'</a>':'<a class="'+vars.prefix+'toggle '+vars.prefix+'play '+vars.prefix+'btn">'+settings.playText+'</a>';
                vars.container.append(buttons);
                vars.buttons.play=vars.container.find('.'+vars.prefix+'toggle');
                vars.buttons.play.click(function(){
                    if(vars.isPlaying===false){
                        play();
                    }else{
                        pause();
                    }
                });
            }
            vars.container.find('.'+vars.prefix+'btn').css({
                position:'absolute',
                display:'block',
                cursor:'pointer'
            });
            if(settings.showControls!=='always'){
                var allControls=vars.container.find('.'+vars.prefix+'btn');
                allControls.stop(true,true).fadeOut(0);
                if(settings.showControls==='hover'){
                    vars.container.mouseenter(function(){
                        allControls.stop(true,true).fadeIn(settings.controlFadeTime);
                    }).mouseleave(function(){
                        allControls.delay(200).fadeOut(settings.controlFadeTime);
                    });
                }
            }
            if(settings.showControls!=='never'){
                vars.container.addClass(vars.prefix+'show-controls');
            }
            vars.items=$slider.children();
            vars.items.addClass(vars.prefix+'item');
            vars.items.first().addClass(vars.prefix+'active');
            var sliderStyles=settings.styles.split(','),style;
            $.each(sliderStyles,function(i,cssAttribute){
                style=$.trim(cssAttribute);
                vars.container.css(style,$slider.css(style));
                $slider.css(style,' ');
                switch(style){
                    case'width':case'height':
                        $slider.css(style,'100%');
                        break;
                }
            });
            if(vars.container.css('position')=='static'){
                vars.container.css('position','relative');
            }

И ВОТ ЭТА ГАДОСТЬ!!!
$slider.css({
             top:'auto',
             left:'auto',
             position:'relative'
            });
Ответить с цитированием