The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
CSS - Change image when mouse is over - GREAT!
Hello!, I want to make my "reply.gif" buttom change when mouse is over. I find a tutorial... a great one... but when I put the code on my "showthread" template, not work... maybe someone can help me. Just need to see how insert this code around the image: PHP Code:
Im attaching a .rar file: inside you can find a .html with his .css where you can see what Im talking about. MY SHOWTHREAD PHP Code:
[left] THANKS!!!
|
#2
|
|||
|
|||
You should use javascript for this... I hate it when people abuse CSS. Doing things in CSS when its SOOO much easier and more efficient to do it using other methods... Seriously, using CSS to display images? WTF is wrong with IMG tags?
Code:
var restoring = new Array(); function rollover(which, towhat){ restoring[which] = which.src; which.src = towhat; } function rollout(which){ which.src = restoring[which]; } Code:
<a onmouseover="rollover(imgName, 'newimage.png')" onmouseout="rollout(imgName)" href="link.php"><img src="oldimage.png" name="imgName"></a> |
#3
|
|||
|
|||
Jaxel are you sure that usign Java is better than css????
And... easy?? Tomorrow I´ll try and let you know if works... thanks! |
#4
|
||||
|
||||
if your going to use css make the link like so. <a href="link/to/file" rel="no-follow" id="new reply">Text</a>
a#reply { display:block; height: 20px; width:120px; background: url(image url); } a#reply :hover { display:block; height: 20px; width:120px; background: url(image url);background-position:-120; } this makes it a roll over link and helps your SEO. make it so your image has to shades on thats one on top of the other one for the hover one for the regular status. Switch size info with your own size info and img source as well. Should work if not PM me and I can do more if you had images. |
#5
|
|||
|
|||
PM Sent Pein, thanks
|
#6
|
|||
|
|||
I just figured put how make this works... Just remaind one question:
https://vborg.vbsupport.ru/showthrea...04#post1884304 thanks |
#7
|
||||
|
||||
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Test</title> <style type="text/css"> a#testbtn { background-repeat: no-repeat; background-image: url('images/testbtn.jpg'); background-position:0px -20px; width:120px; height:20px; display: block; } a:hover#testbtn { background-repeat: no-repeat; background-image: url('images/testbtn.jpg'); background-position:0px 0px; width:120px; height:20px; display: block; } </style> </head> <body> <a href="#" id="testbtn" rel="no-follow"></a> </body> </html> HTML Code:
background-position:0px -20px; Check the code of the demo files to see how I made the image. |
#8
|
|||
|
|||
Quote:
|
#9
|
|||
|
|||
Quote:
THANK YOU SO SO MUCH |
#10
|
||||
|
||||
Welcome did the one for press hover and normal state work for you, the one I sent you over a PM?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|