Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
jQuery Rotator Plugin - mouseover

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side
View previous topic :: View next topic  
Author Message
Shinzon



Joined: 15 Jun 2008
Posts: 23

PostPosted: 31.10.2009 10:04    Post subject: jQuery Rotator Plugin - mouseover Add user to your forum ignore list Reply with quote

Da li bi mi netko, tko se razumije u iQuery, mogao reći na koji način zaustaviti rotaciju na mouseover?
Radi se o ovom pluginu: http://www.socialembedded.com/labs/jQuery-Rotator-Plugin/jQuery-Rotator-Plugin.html

Ili možda znate skriptu koja radi na sličan način.
Zahvaljujem.
Back to top
View user's profile Send private message
darkqueliss



Joined: 27 May 2008
Posts: 1058

PostPosted: 31.10.2009 12:14    Post subject: Re: jQuery Rotator Plugin - mouseover Add user to your forum ignore list Reply with quote

Ovdje pogledaj:

http://www.socialembedded.com/labs/jQuery-Rotator-Plugin/jquery.rotator.js
Back to top
View user's profile Send private message
Shinzon



Joined: 15 Jun 2008
Posts: 23

PostPosted: 31.10.2009 19:13    Post subject: Add user to your forum ignore list Reply with quote

Moram priznat da ne shvaćam što si htio reći tim odgovorom?
Pa da se razumjem u JS ne bi tražio pomoć.
Back to top
View user's profile Send private message
darkqueliss



Joined: 27 May 2008
Posts: 1058

PostPosted: 31.10.2009 19:19    Post subject: Add user to your forum ignore list Reply with quote

Cekaj, trebas se razumijet u js da bi znao ovo rjesit?



Quote:
var defaults = {
ms: 2000,
n: 1,
autoHeight: false
};



Probaj tu negdje 0 stavit il nesto, ni ja neznam napamet, istrazuj malo, probaj googlat...
Back to top
View user's profile Send private message
il collonelo



Joined: 10 Mar 2005
Posts: 28
Location: Zagreb

PostPosted: 01.11.2009 23:36    Post subject: Add user to your forum ignore list Reply with quote

probaj postavit setInterval u neku varijablu te na mouseover pozvat clearInterval(ime varijable)
Back to top
View user's profile Send private message
strija



Joined: 14 Sep 2003
Posts: 473
Location: Čakovec

PostPosted: 02.11.2009 11:41    Post subject: Add user to your forum ignore list Reply with quote

Evo na brzinu customiziran plugin sa opcijom koju trebas:
Code:
/*
 *  jquery.rotator
 *  Version: 0.1
 */
 
(function($){ $.fn.rotator = function(options){

    var defaults = {
      ms: 2000,
      n: 1,
      autoHeight: false,
      mouseOverStop: false
   };
 
    var options = $.extend(defaults, options);
    var interval = false;
   
   return this.each(function(index) {
      
      var $this = $(this);
      
      var initialHeight = 0;
      $this.children().filter(":lt("+options.n+")").each(function(index,item){
          initialHeight += $(item).height();
      });
      
      $this.height(initialHeight);
      
      interval = setInterval(runRotator, options.ms);
      
       if (options.mouseOverStop == true) {
          $this.hover(
             function() { clearInterval(interval); }
            ,function() { interval = setInterval(runRotator, options.ms); }
          );
       }
      
       function runRotator() {
         var childHeight = $this.children().filter(":first-child").height();
         var animParams = {scrollTop: (childHeight) + "px"};
         var autoHeight = 0;
         $this.children().filter(":lt("+(options.n+1)+")").each(function(index,item){
             if(index>0)autoHeight += $(item).height();
         });
         if(options.autoHeight)animParams = $.extend({height:(autoHeight) + "px"}, animParams);
         
         $this.animate(animParams, 500, function(){
             $this.scrollTop(0);
             $this.append($this.children().filter(":first-child"));
            $this.css("overflow","hidden"); //Chrome hack
         });
       }
      

   });

 
}})(jQuery);



Samo ga pozovi na ovaj nacin:
Code:
$("#rotator1").rotator({n: 3, autoHeight: true, mouseOverStop: true});


Nisam testirao u svim browserima, ali mislim da bi trebalo raditi.

_________________
We can exist in ambiguity, but it means the deepest loneliness. | creolab.hr | thefarewellreason.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group