GumSlone wrote:
why dont you use/"steal" the javascript from that site?
http://www.urokitv.ru/js/KernelTeamImageRotator.js?v=3.8.1
I am intended to use this on commercial purpose, so i dont think stealing would be a good things.because they(kvs) use it for commercial purpose only. and in other hand, i have undefined number of images. while i release whole script for users, users may upload 2 or 3 or 6 or 9 images as screenshot.which going to be use on this line.so i can;t fixed number to "5" or something else as you mentioned. that's why i liked they way
something else provide code.
so i am going to use something like this:
$filepre = ''.$br.'/filethumb/'.$name.'.jpg';
$filess = ''.$br.'/ss/'.$name.'.jpg';
$filess1 = ''.$br.'/ss/'.$name.'1.jpg';
$filess2 = ''.$br.'/ss/'.$name.'2.jpg';
$filess3 = ''.$br.'/ss/'.$name.'3.jpg';
$filess4 = ''.$br.'/ss/'.$name.'4.jpg';
$filess5 = ''.$br.'/ss/'.$name.'5.jpg';
$filess6 = ''.$br.'/ss/'.$name.'6.jpg';
$filess7 = ''.$br.'/ss/'.$name.'7.jpg';
$filess8 = ''.$br.'/ss/'.$name.'8.jpg';
$filess9 = ''.$br.'/ss/'.$name.'9.jpg';
if (file_exists($filess)) { $filss = ''.$filess.'';} else {$filss = '';}
if (file_exists($filess1)) { $filss1 = ''.$filess1.'';} else {$filss1 = '';}
if (file_exists($filess2)) { $filss2 = ''.$filess2.'';} else {$filss2 = '';}
if (file_exists($filess3)) { $filss3 = ''.$filess3.'';} else {$filss3 = '';}
if (file_exists($filess4)) { $filss4 = ''.$filess4.'';} else {$filss4 = '';}
if (file_exists($filess5)) { $filss5 = ''.$filess5.'';} else {$filss5 = '';}
if (file_exists($filess6)) { $filss6 = ''.$filess6.'';} else {$filss6 = '';}
if (file_exists($filess7)) { $filss7 = ''.$filess7.'';} else {$filss7 = '';}
if (file_exists($filess8)) { $filss8 = ''.$filess8.'';} else {$filss8 = '';}
if (file_exists($filess9)) { $filss9 = ''.$filess9.'';} else {$filss9 = '';}
<html> <head> <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.1.1.min.js"></script> <script> $(function() { $('img').on('mouseover', function() { var self = this, i = 0, images = $(this).data('mouseover').split(/\s+/); (function nextImage() { var next = images[i++ % images.length].split('#'); $(self).data('timeout', setTimeout(function() { self.src = next[0]; nextImage(); }, next[1] || 200)); })(); }).on('mouseout', function() { clearTimeout($(this).data('timeout')); this.src = $(this).attr('src'); }); }) </script> </head> <body> <img src="<?echo "$filepre ";?>" data-mouseover="<?echo "$filss $filss1 $filss2 $filss3 $filss4 $filss5 $filss6 $filss7 $filss8 $filss9";?>" /> </body> </html>
My coding way might be not standard,but i like this way. and i want something like this simple & working. hope you understand 🙂