jovypinoy 0 Junior Poster in Training

Hello guys, I hope someone can help me on my problem. Actually I insert a jquery funtion to pause my slideshow but it didn't work..

Thanks for the help in advance.

Here is my codes

Variables for the links and images of slideshow.

<script>
var links = new Array();
links[0] = 'http://www.paespi.vectoreeno.com/about-us/paespi-who-are-we';
links[1] = 'http://www.paespi.vectoreeno.com/gallery/breakfast-forum-sept-23-2011';
links[2] = 'http://www.paespi.vectoreeno.com/articles';

var imageUrl = new Array();
var imageTitle = new Array();
var imageCaption = new Array();

This is to call the image in my directory

<?php
for($counta=0; $counta<$count; $counta++)
{
    echo "imageTitle[".$counta."]=\"".$imageTitle[$counta]."\";";
    echo "imageUrl[".$counta."]=\"".$imageURI[$counta]."\";";
    echo "imageCaption[".$counta."]=\"".$imageCaption[$counta]."\";";
}

?>

Slideshow codes and the dots.

jQuery.noConflict();

jQuery(document).ready(function() {

var a=0;
   
    function changepicture() {
        jQuery("#slideshowpicture img").attr('src', imageUrl[a]);
        document.getElementById("changeable").href = links[a];
        jQuery("#slideshowtitle").html(imageTitle[a]);
        jQuery("#slideshowarticle").html(imageCaption[a]);
        jQuery(".dot"+a).attr('src', "<?php echo $templateuri; ?>/images/home/dotw.jpg");
       
        if( a == 0) {
            a++;
            jQuery(".dot<?php echo $count-1; ?>").attr('src', "<?php echo $templateuri; ?>/images/home/dotb.jpg");
           
        }
        else if( a == <?php echo $count-1; ?>) {
            b = a - 1;
            a = 0;
            jQuery(".dot"+b).attr('src', "<?php echo $templateuri; ?>/images/home/dotb.jpg");
        }
        else {
            b=a-1;
            a++;
            jQuery(".dot"+b).attr('src', "<?php echo $templateuri; ?>/images/home/dotb.jpg");
        }
    }
    changepicture();
    var slideinterval = setInterval(changepicture, 4000);

This is my function to pause an slideshow. But it failed. :(

$('#slideshow').hover(function() {
        clearInterval(slideinterval);
    },
    function() {
        slideinterval =  setInterval( "changepicture()", 4000 );
    });

    });
    </script>

Few codes under this script codes.

<div id="main" class="frontpage">
	<div id="slideshow">
		<div id="slideshowtext">
			<div id="slideshowtext-wrap">
				<div id="slideshowtitle">

Thanks for the help in advance.. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.