Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> JavaScript
Author Message
killing-hours
RavenNuke(tm) Development Team



Joined: Oct 01, 2010
Posts: 438
Location: Houston, Tx

PostPosted: Tue Nov 09, 2010 4:21 pm Reply with quote

Hey all-

Running into a snag with a new slider for RN. I can't get the durn thing to pause.

Here is the code to make it autoscroll...

Code:
$autoslide = setInterval(function(){

               $leftD = $(".cs_leftBtn").css("display");
                  $rightD = $(".cs_rightBtn").css("display");

            if($leftD == "none"){
               $dir = "goRight";
               }
            if($rightD == "none"){
               $dir = "goLeft";
               }

            ($dir == "goRight") ? $curButt=".cs_rightBtn" : $curButt=".cs_leftBtn";
            $($curButt).trigger("click");
            }, 2000);
         });


Courtesy of [ Only registered users can see links on this board! Get registered or login! ] (half way down the comments)

I've searched the net for ways to pause this thing but everything I've found either breaks the code or flat out doesn't work. I've tried to many different variations to list here in order to get it to pause so I won't bore you with all that.

the slider has an "id" of "one".

this seems to make sense to me but doesn't work.

Code:
$("#one").hover(function(){

      clearInterval($autoslide);
});

_________________
Money is the measurement of time - Me
"You can all go to hell…I’m going to Texas" -Davy Crockett 
View user's profile Send private message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Tue Nov 09, 2010 6:48 pm Reply with quote

I did not test this at all. I just typed it up and pasted it here. It is just something to maybe give you an idea.

Code:


   var autoslide = setInterval(headline_rotate, 2000);

   $('#one').hover(function() {
         clearInterval(autoslide);
      }, function() {
         autoslide = setInterval(headline_rotate, 2000);
         headline_rotate();
      });

   function headline_rotate() {
      $leftD = $(".cs_leftBtn").css("display");
      $rightD = $(".cs_rightBtn").css("display");
      if($leftD == "none"){
         $dir = "goRight";
      }
      if($rightD == "none"){
         $dir = "goLeft";
      }
      ($dir == "goRight") ? $curButt=".cs_rightBtn" : $curButt=".cs_leftBtn";
      $($curButt).trigger("click");
   }

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
killing-hours







PostPosted: Tue Nov 09, 2010 7:12 pm Reply with quote

Will test now and post results. thanks for taking the time to help out.


Edit*** Negative Ghost Rider. Breaks the code... thanks for the assistance though. I'll keep trying. (may just be a syntax error somewhere)

2nd Edit***

Got going to fast.... accidentally deleted a trailing " }); ", works perfectly. Thanks Palbin!

New slider for RN coming soon. I'll release it to nuken so he/she can release it to the masses.
 
Palbin







PostPosted: Tue Nov 09, 2010 7:47 pm Reply with quote

Looking at what I posted again:

Code:


   $('#one').hover(function() {
         clearInterval(autoslide);
      }, function() {
         autoslide = setInterval(headline_rotate, 2000);
         headline_rotate();
      });


I do not think you need the headline_rotate();
Code:


   $('#one').hover(function() {
         clearInterval(autoslide);
      }, function() {
         autoslide = setInterval(headline_rotate, 2000);
    });
 
killing-hours







PostPosted: Tue Nov 09, 2010 8:36 pm Reply with quote

Already took that out. Wink
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> JavaScript

View next topic
View previous topic
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©