PDA

View Full Version : how to Pause Scroller javascript on mouse over



inderjeetsinghsethi
09-29-2010, 08:57 AM
http://www.dynamicdrive.com/dynamicindex2/sagscroller.htm

hello friends, thanks for wonderful js, i want to add some extra functionality in this JS. i want to pause the JS on mouse over, so help me out to solve this, i m very bad in js.

any further suggestions would be appriciable.

Thanks and Regards
Inderjeet Singh Khalsa:D

jscheuer1
09-29-2010, 03:47 PM
Well, from the demo, the SAG scroller demo #2 is auto, so would qualify for this (from the demo page, Step 1, additions highlighted):


//SAG scroller demo #2:

var sagscroller2=new sagscroller({
id:'mysagscroller2',
mode: 'auto',
pause: 2500,
navpanel: {show: false},
animatespeed: 400 //<--no comma following last option
});
jQuery(function($){
$('#mysagscroller2').hover(function(){
sagscroller2.stopscroll();
}, function(){
sagscroller2.scrollmsg(true);
});
});

Note: The variable name, sagscroller2 must agree where colored red (three places), and the id, mysagscroller2 must agree where colored green (two places).

Or, if you still want the navpanel:


var sagscroller2=new sagscroller({
id:'mysagscroller2',
mode: 'auto',
pause: 2500,
animatespeed: 400 //<--no comma following last option
});
jQuery(function($){
var sag = sagscroller2;
$('#mysagscroller2').hover(function(){
sag.stopscroll();
}, function(){
sag.stopscroll();
sag.scrollmsg(true);
}).find('.sliderdesctext').unbind('click').click(function(){
sag.stopscroll();
sag.scrollmsg(false);
});
});

abrajguru
06-03-2012, 01:24 PM
<script>

//SAG scroller demo #1:

var sagscroller1=new sagscroller({
id:'mysagscroller',
mode: 'auto',
pause: 2500,
animatespeed: 600 //<--no comma following last option
});
jQuery(function($){
var sag = sagscroller;
$('#mysagscroller').hover(function(){
sag.stopscroll();
}, function(){
sag.stopscroll();
sag.scrollmsg(true);
}).find('.sliderdesctext').unbind('click').click(function(){
sag.stopscroll();
sag.scrollmsg(false);
});
});

//SAG scroller demo #2:

var sagscroller2=new sagscroller({
id:'mysagscroller2',
mode: 'auto',
pause: 2500,
animatespeed: 600 //<--no comma following last option
});
jQuery(function($){
var sag = sagscroller2;
$('#mysagscroller2').hover(function(){
sag.stopscroll();
}, function(){
sag.stopscroll();
sag.scrollmsg(true);
}).find('.sliderdesctext').unbind('click').click(function(){
sag.stopscroll();
sag.scrollmsg(false);
});
});

</script>