Rollover Image Tutorial

free web hosting
Open Discussion > CONTRIBUTE > The Internet > Web Design

Rollover Image Tutorial

arcanistherogue
make it so that i have a button, probably an opaque one, and when it is scrolled over it displays another image, a solid one.

I believe this is a javascript command, and I already have all the images set, i just need to know the coding.

Thanks for the help.

Reply

OpaQue
IT is called a Rollever image.

Put the following code between the head tag to preload the images. This will not screw up the effect.
CODE
<script language="Javascript">
<!--
if (document.images) {
    button1 = new Image
    button2 = new Image

    button1.src = 'img1.gif'
    button2.src = 'img2.gif'
}
//-->
</script>


Then. When you want to insert such an image link, put the following code.
CODE
<a href="http://trap17.com" onmouseover="document.rollover.src=button2.src" onmouseout="document.rollover.src=button1.src"><img src="img1.gif" border=0 name="rollover"></a>


Hope this helps,
OpaQue

Reply

bjrn
Depending a bit on what you have you don't even need JavaScript. If you have a form with a form button, you'll have to use JavaScript because of IE's lack of understanding of CSS. But if you have a normal link you can do everything with CSS (I've tested this in Firefox and IE).

This would work just fine, put this in the head of your page:
CODE
<style type="text/css">
a.btn div{ background: url(img1.gif);}
a.btn:hover div{ background: url(img2.gif); }
a.btn div { height:20px; width:150px; text-align:center;}
</style>

and have the link look like so:
CODE
<a class="btn" href="http://trap17.com"><div>Click here!</div></a>

You don't need to have text inside the div if you don't want to, it'll still work. Perhaps it can even be made a bit more compact, but I wasn't sure how to easily set a fixed size for it without having divs inside the anchor tag (and still have it work in IE).


Going back to your original question. I assume you meant it should go from being transparent to opaque (or the other way around). Just remove the text between the divs, have one of the images as standard and the other one for the :hover and you'll be fine.

Hope this helps smile.gif

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. rollover image ebay - 187.72 hr back. (1)
Similar Topics

Keywords : rollover, image

  1. Testing Of The Auto Image Resizer
    This might be useful for other members also! (0)
  2. Finding The Rgb Color Of An Image
    Using any programming language (3)
    hello friends i am doing a project , in that i am inneed to fine the mean RGB value of a particular
    image , is there any program in any language which can do this ? the input to the program will be
    any image ( can be linked in the program) and the putput must be the mean RGB value of that
    particular image , is this Possible ? If so please post the Coding , no matter in what ever language
    it may be written.Thanks in Advance....
  3. How To Make Image Buttons Act As Submit Button
    (8)
    Hi guys I m making a personal website .... I asked in the forum how to create and use images as
    buttons...thanks for your help.. I can make them work as links....give some hovering effects
    etc...they work very well..untill I use them in forms and use them as SUBMIT or RESET button...when
    I do this nothing happens on clicking the image button... the code I use is like but there
    is problem in making them act as SUBMIT or RESET button. I have tried very hard to make it work, but
    didn't succeed .... I know html and CSS quite well but , don't know....Javascr....
  4. How To Create Cool Image Buttons
    (7)
    Hi guys ... I m making a personal site thats for me a nd my friend group. What I need is a tool
    which can make cool image buttons to use in my HTML pages. Is there any site which offers such
    software or the buttons itself for free. I would like to make them on my own, I just need to know
    the tool.I can't go for an expensive tool like photoshop or corel. So please suggest me a free
    tool. Thanks.......
  5. Render Request Please..
    need this image renderd please. (0)
    Hi, im realy new to photoshop and i realy suck at rendering /sad.gif" style="vertical-align:middle"
    emoid=":(" border="0" alt="sad.gif" /> so i was wondering if anybody could render this image for me
    please Thank you so much for whoever does it. /smile.gif" style="vertical-align:middle"
    emoid=":)" border="0" alt="smile.gif" />....
  6. Problem Aligning In Firefox
    Problem aligning an image in Firefox. (9)
    Hello everyone! I am new here. /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
    alt="smile.gif" /> I am looking for some advice...I've been fiddling around with my site for
    the last few hours and have had no luck! www.thelatency.com/test/tour_dates.php as you can the
    image header above all the text is aligned perfectly in IE and not in Firefox. Any ideas? Thanks
    so much in advance. /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif"
    />....
  7. Image Hosting Link On My Website?
    need help (2)
    Please look at the imagefilez.com box at the top part of most of the pages at trap 17. I'm
    looking to place any kind of image hosting box similar to that one on my own website. The hosting
    service can be any website but I'm just trying to find a way that I can have my own image
    hosting box on the site. I don't care if it does the hosting through another site. Please, any
    help to create a image hosting box on my website would be greatly appreciated. /tongue.gif"
    style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" />....
  8. Trap17 Dynamic Recent Post/topic Image
    (17)
    Some may remember a while back I created a dynamic image that would tell you your post count and
    last active for trap. It had a bit of a run but then died off. It just wasn't very useful.
    BUT NOW I am presenting the most epic trap17 image Ever. This one is SUPER customizable and already
    works for ALL MEMBERS ! It is designed to be put in your sig so other members can see the
    recent topics you have written. It is still in early early beta stage but soon it will have the
    date posted along with some other cool features. So I'm sure you are all excited t....
  9. Exact Image Index
    (2)
    i had this idea a while back but i guess the genious at google are a couple steps ahead again, but
    it's the idea is instead of relying on the tags of an image when searching it actualy reads
    what's realy in that image. this can be a great step ahead witch can eliminate some mistakes
    that happen when searching images. i like it /smile.gif" style="vertical-align:middle" emoid=":)"
    border="0" alt="smile.gif" />. CHECK IT:
    http://www.bigblueball.com/forums/general-...html#post229009 ....
  10. Link Image Css Bug In Firefox
    Can anyone help me? (7)
    I have a problem in a site I am creating. I have styled my post content links in the following
    way. CODE #post-content a {     background-color: #bf6f3c;     color: #fff;
        padding: 2px 2px 1px 2px;     border-bottom: 1px solid #7f4926; } #post-content
    a:hover {     color: #f5fac7; } And when I insert an link image like so: There
    seems to be an extra border inherited from my #post-content a style. I have attached the screenshot
    to show the problem. This was how my link image should look like: CODE #post-content a img { ....
  11. Image Upload
    ?!? (11)
    I need the image upload script which automatically resized the image by specified size and store it
    in the specified folder.....
  12. Image Viewing
    (3)
    IrfanView If you are looking for something better than the softwares for image viewing included in
    windows, you can try these incredible program, really small, really fast, and simple to learn you
    can basic edit your photos with IrfanView, and its free /biggrin.gif" style="vertical-align:middle"
    emoid=":D" border="0" alt="biggrin.gif" /> here, a link to download, this is the version i use i
    have no problems with this one: http://rapidshare.com/files/106016448/iview397.rar ....
  13. Cascading Windows
    How do I make the image? (5)
    Hi there everybody! Well as the title says I'm wanting to make something like this But
    I've got WindowsXP. The image I'm wanting to make is similar to the abouve but the windows
    are turned slightly as if they were a peice of paper. Is there a program that does it? Heres another
    image of what I'm wanting to do. Thanks guys Karlos....
  14. The Right Web Album/image/photo Album Host?
    a question regarding the confusion of choosing the right host (9)
    Hello, since I can't post to the Internet secion of this forum, I'll post it here. I am
    still doing my best to get more than 30 credits, right now I only have the half Anyway alot of our
    relative uses Flickr (which sucks--limitations) and Kodak photo sharing thingy. Now, me I wanted to
    be unique at the same time to help other relatives in choosing the right site to upload their
    pictures of course, with a wonderful features. Can you please help me or recommend me some photo
    sharing sites, where I can upload my pictures or pictures of our family? If possible, th....
  15. Background Image Swap Script
    Change a Background Image based on clock time (15)
    Background Image Changer Script To swap the background image from your CSS file according to the
    Server Clock Time. 1.) In your CSS file, add the following rule: CODE body {
        background: url(time.png); } 2.) Create a "folder" named time.png. 3.) Into the
    folder, place three images named morning.png, day.png, night.png. 4.) Also, in the same folder,
    create an index.php file and copy/paste the following script. CODE <?php $hour =
    date('H'); if ($hour < 12 ) {     $image =
    "morning.png"; } ....
  16. Do You Use Imagefilez.com?
    ImageFilez.com : Free Image and Video Hosting (36)
    Do you use ImageFilez.com? If so, for what and how long? If not, why? /huh.gif"
    style="vertical-align:middle" emoid=":huh:" border="0" alt="huh.gif" /> Please vote and reply to
    this thread with your responses. I don't personally, because I have an account on Photobucket
    and ImageShack, and I sometimes use the Free Hosting that comes embedded into my forum and at the
    site I moderate.....
  17. Google Rolling Image Trick
    (11)
    You might already know this but it doesn't really matter.... OK this isnt a useful trick or
    something, its just something thats fun to see. 1. Goto Google 2. Click "images" 3. Type "jesus"
    or any other word 4. You will get a page which is full of images 5. Then delete the item from the
    address bar and paste the below script: CODE java script:R=0; x1=.1; y1=.05; x2=.25; y2=.24;
    x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function
    A(){for(i=0; i<DIL; i++){DIS=DI[ i ].style; DIS.position=&#....
  18. Image Not Taking The Right Size In Web Page
    An image is correct when designed, but not when put in a website (1)
    When trying to make a web page with a GIF image on it which runs a coloured bar along the top and a
    coloured curve along the side, I come across the weird thing that, when I put the image on a web
    site, it does not take in the whole top and does not run from top to bottom completely. The image is
    made in Adobe Photoshop at a resolution of 1024X768 pixela and looks correct , ie. the horizontal
    bit runs completely from left to righ and the vertical bit completely from topright to bottom right,
    yet when put in to the web page, it shows with big margins left and right and to....
  19. Need To Shrink The File Size Of Web Image? - Photoshop Tricks
    (3)
    QUOTE NEED TO SHRINK THE FILE SIZE? USE TRANSPARENCY Want a killer tip for squeezing even
    more size out of your GIF Web images? Make something transparent. That's right, if you can pick
    an area of your image to make transparent, your file size will drop like a rock. For example, if
    you're putting a logo over a white background and you can make the white area around the logo
    transparent, your file size will be significantly smaller. The transparent areas are virtually
    ignored when determining file size, because, after all, there's nothing there. ....
  20. A Simple Php Captcha - Image Validation
    (21)
    OK, I recently had the need to create a PHP CAPTCHA system for a friend, and I am sharing this as a
    tutorial with the good people here at Trap17. I am sure you have all seen a CAPTCHA before (although
    you may not have known what it was called). They are the little codes you often have to enter when
    you register with a site, to make sure you are a person and not an automated script. Some common
    examples look something like this: My system doesn't really do anything as fancy, but I
    think that it is slightly more readable that some of those that get generated. Every....
  21. Mylot.com
    earn a lot of money on discussion and upload image (16)
    The site is mylot and all you have to do is stay active in the site by creating or responding to
    discussions and upload photos. You get 1 cents minimum for each response you post or when someone
    responds to your topic. Your rating in the site goes up by 1 for each unique discussion you take
    part in or when someone responds to the discussions started by you for the first time. They pay you
    based on the quality of the posts you make. so, if you really make a worthy reply, you can expect
    5-10 cents for a reply. Respond to as many discussions as possible and earn. You ca....
  22. Scrolling Images?
    How to Make an Image Scroll With the Page (5)
    I'm trying to make my homepage look a little fancier and I've got a nice background image,
    but I want it to scroll with my page, like if you scroll down the image will still appear like it
    does on the top of the page. Can someone tell me how to do this? I'm using Microsoft Frontpage
    to edit it. I'm not sure what programming language this would be, probably CSS or Javascript,
    but I can edit the page script with Notepad or something to make this work. Right now the page is
    purely HTML, so whichever language this is, can somebody also give me the tags and ma....
  23. Wmp (windows Media Photo) - The New Image File Format From Microsoft
    windows media photo WMP - could replace JPGs and GIFs? (33)
    Microsoft have decided to come up with a new image format to add to the common JPGs, GIFs and PNGs
    of today. It is to be called Windows Media Photo format or WMP for short. It is said to
    "Surpass the limitations of existing file formats" and here is what it'll offer: Numerous
    colour formats for printing and displaying High-quality lossy or even lossless compression
    Really efficient decoding for numerous resolutions For more features, visit
    http://www.microsoft.com/whdc/xps/wmphoto.mspx Presumeably, the JPEG2000 format or JP2 was
    ....
  24. How To Create Embed Image Mail In Gmail
    (56)
    Hi to all ! Anybody can help me to create an email with embedded image so that mail reader
    automatically see that image. Moreover I wont attached that image as it appears small in size in on
    gmail. Thanks in Advance. ....
  25. Watermark Your Image With Simple Php Script
    found it on the net (35)
    This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips &
    Scripts site. Just in case the site may not show, I will include the code here: List of things
    needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3.
    script below with name (i.e. watermark.php) CODE <?php // this script creates a watermarked
    image from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly
    transparent gif image with the watermark - goes in the same directory as this script // ....
  26. Expanding Image Gallery
    Images Expanding on a mousover (6)
    I was looking through wired today, and i noticed :
    http://www.hotwired.com/webmonkey/06/08/index2a.html looks like a pretty nifty image gallery
    effect, though i noticed that it wont display properly in FireFox. Does anyone have any links or
    examples of other image gallery code, i find it pretty fascinating.....
  27. What Is Theme Of Your Current Desktop Image
    about images, pictures... (19)
    My current desktop image is standard windowsXP Home image. /tongue.gif' border='0'
    style='vertical-align:middle' alt='tongue.gif' /> And U? ....
  28. Making A Scroll Bar In Flash
    with an image and words on it (4)
    does anybody know how to make a scrollbar for my game page I am making on my site. This whole site
    is completely in flash. I know how to make a scrollbar for just words but not when there is an
    image on there also. Does anybody know?....
  29. Image Preloader With Progress Bar Status
    Pure Client-Side JavaScript tested in 4 Browsers! (23)
    Tutorial: Image Preloader with Progress Bar, by Rob J. Secord, B.Sc. (SystemWisdom)
    Description : A Tutorial for a Client-Side Image Preloader with Dynamic Real-Time Progress Bar
    Indicator written in JavaScript! Tested to work with 4 Major Internet Browsers: Firefox, MSIE,
    Netscape, Opera (Complete sample solution provided at end of tutorial, just put it on your
    web-server, add your images and go!) Intended Audience : Beginner to Intermediate Web
    Developers. Although this tutorial will cover some advanced aspects of JavaScript, I will try to
    explain....
  30. Turning An Image Into A Cartoon Style - Photoshop
    Tutorial on cartooning images. (30)
    This tut will show you how to make a photo look cartoonish in three easy steps... 1)Open your
    image in photoshop, doesnt really mater what size or shape anything really a landscape, city, or a
    person. I am using a picture of a football player in this example 2)Go up to
    Filter>Blur>Gaussian Blur and set the radius at 3.0 or higher depending on the effect your looking
    for. 3)Last go Edit>Fade Gaussian Blur. A window will pop up... set the mode to darken for tha
    cartoonish effect or to any other mode for plenty of other effects. Lower the opacity if you
    don't....

    1. Looking for rollover, image

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for rollover, image

*MORE FROM TRAP17.COM*
Similar
Testing Of The Auto Image Resizer - This might be useful for other members also!
Finding The Rgb Color Of An Image - Using any programming language
How To Make Image Buttons Act As Submit Button
How To Create Cool Image Buttons
Render Request Please.. - need this image renderd please.
Problem Aligning In Firefox - Problem aligning an image in Firefox.
Image Hosting Link On My Website? - need help
Trap17 Dynamic Recent Post/topic Image
Exact Image Index
Link Image Css Bug In Firefox - Can anyone help me?
Image Upload - ?!?
Image Viewing
Cascading Windows - How do I make the image?
The Right Web Album/image/photo Album Host? - a question regarding the confusion of choosing the right host
Background Image Swap Script - Change a Background Image based on clock time
Do You Use Imagefilez.com? - ImageFilez.com : Free Image and Video Hosting
Google Rolling Image Trick
Image Not Taking The Right Size In Web Page - An image is correct when designed, but not when put in a website
Need To Shrink The File Size Of Web Image? - Photoshop Tricks
A Simple Php Captcha - Image Validation
Mylot.com - earn a lot of money on discussion and upload image
Scrolling Images? - How to Make an Image Scroll With the Page
Wmp (windows Media Photo) - The New Image File Format From Microsoft - windows media photo WMP - could replace JPGs and GIFs?
How To Create Embed Image Mail In Gmail
Watermark Your Image With Simple Php Script - found it on the net
Expanding Image Gallery - Images Expanding on a mousover
What Is Theme Of Your Current Desktop Image - about images, pictures...
Making A Scroll Bar In Flash - with an image and words on it
Image Preloader With Progress Bar Status - Pure Client-Side JavaScript tested in 4 Browsers!
Turning An Image Into A Cartoon Style - Photoshop - Tutorial on cartooning images.
advertisement



Rollover Image Tutorial



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE