Page 1 of 5 123 ... LastLast
Results 1 to 10 of 48

Thread: How to make image rollover?

  1. #1
    Join Date
    Feb 2008
    Location
    Greece
    Posts
    235

    Default How to make image rollover?

    Dose someone know how to make image rollover when you put your mouse over the image.
    Like youporn and xhamsrer.

  2. #2

    Default Re: How to make image rollover?

    not 100% sure, but I think you can do it by using using the standard javascript rollover syntax.

    Something like:

    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>
    Then call it within the IF statement:

    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 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.
    I'll try to test it out later and post a tested code.

  3. #3
    Join Date
    Feb 2008
    Location
    Greece
    Posts
    235

    Default Re: How to make image rollover?

    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 :(

  4. #4
    Join Date
    Jan 2008
    Posts
    216

    Default Re: How to make image rollover?

    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...

  5. #5
    Join Date
    Mar 2008
    Posts
    8

    Default Re: How to make image rollover?

    it works... :P

  6. #6
    Join Date
    Jan 2008
    Posts
    216

    Default Re: How to make image rollover?

    Post the working code, pls! ;)

  7. #7
    Join Date
    Mar 2008
    Posts
    8

    Default Re: How to make image rollover?

    just look into xhammster source code. I simply copied from there.

  8. #8
    Join Date
    Jan 2008
    Posts
    216

    Default Re: How to make image rollover?

    Quote Originally Posted by Whitenoise
    just look into xhammster source code. I simply copied from there.
    Not helping at all!

  9. #9

    Default Re: How to make image rollover?

    Mistake, sorry.

  10. #10
    Join Date
    Jan 2008
    Posts
    216

    Default Re: How to make image rollover?

    I mean, from that you can understand and copy the external JS but not the right code for thumbnail in Vshare.

Page 1 of 5 123 ... LastLast

Similar Threads

  1. [addon] How to make image rollover
    By RAMMSTEIN in forum Template Modifications
    Replies: 35
    Last Post: 11-05-2008, 04:01 PM
  2. Anyone Know How To Make a Facebook App?
    By tnuriel in forum General Discussions
    Replies: 2
    Last Post: 06-02-2008, 11:58 PM
  3. How do I make last users go away?
    By Rodesh in forum General Discussions
    Replies: 1
    Last Post: 03-14-2008, 11:04 PM
  4. Cant make comments
    By imnotblind.com in forum Fixed Bugs
    Replies: 3
    Last Post: 08-13-2007, 08:36 PM
  5. make upgrade for me?
    By ostendo in forum Installation Support
    Replies: 1
    Last Post: 05-24-2007, 08:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •