Dose someone know how to make image rollover when you put your mouse over the image.
Like youporn and xhamsrer.
Dose someone know how to make image rollover when you put your mouse over the image.
Like youporn and xhamsrer.
not 100% sure, but I think you can do it by using using the standard javascript rollover syntax.
Something like:
Then call it within the IF statement:Code:<script language="Javascript"> if (document.images) { thumb1 = new Image thumb2 = new Image thumb1.src = '{$tmburl}/1_{$recent[i].VID}.jpg' thumb2.src = '{$tmburl}/2_{$recent[i].VID}.jpg' } </script>
I don't really know if this is 100% working or not, but it should give you an idea of where to start. It's early and I'm tired.Code:<a href="{$baseurl}/view/{$recent[i].VID}/{$recent[i].seo_name}/" onmouseover="document.rollover.src=thumb2.src" onmouseout="document.rollover.src=thumb1.src"> [img]{$tmburl}/1_{$recent[i].VID}.jpg[/img] {$recent[i].title|truncate:30:"...":true}</a>
I'll try to test it out later and post a tested code.
xhamster.com based with vshare and they make it with this code
Java script
Code:var thumbs=new Array(); var stat=new Array(); var thumb=new Array(); function rotatethumb(i,str) { var loop=0; if (stat[str]) { while ((thumbs[str][i]==0 || i>=3) && loop<100) { if (i>=3) { i=0; } else { i++; } loop++; } if (thumb[str][i].complete) { document.getElementById(str).src=thumb[str][i].src; setTimeout("rotatethumb("+(i+1)+",'"+str+"')",500); } else { setTimeout("rotatethumb("+i+",'"+str+"')",20); } } } function loadthumb(url,str,j) { if (stat[str]) { thumb[str][j].src=url; } } function startr(str,ta,te) { stat[str]=1; var num; var first=1; for(var j=0;j<3;j++) { if (thumbs[str][j]==1) { thumb[str][j]=new Image(); num=j+1; if (first) { first=0; loadthumb(ta+num+te,str,j); } else { setTimeout("loadthumb('"+ta+num+te+"','"+str+"',"+j+")",j*50); } } } rotatethumb(0,str); } function endr(str) { stat[str]=0; }
and the template code is like this
Code:[img]{$tmburl}/1_{$new_video[i].VID}.jpg[/img]
But do not work :(
I asked to afunnysite but i didnt' receive an answer yet... It's gonna be a secret like RSS working on IE7?? :(
Let's see...
it works... :P
Post the working code, pls! ;)
just look into xhammster source code. I simply copied from there.
Not helping at all!Originally Posted by Whitenoise
Mistake, sorry.
I mean, from that you can understand and copy the external JS but not the right code for thumbnail in Vshare.
Bookmarks