Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Show image on mouse over


  • Please log in to reply
2 replies to this topic

#1 Delta16

Delta16

  • Members
  • 417 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Malta
  • Local time:09:50 AM

Posted 18 October 2009 - 07:34 AM

I am using php language. I have an image that when clicked it redirects to another page but, I want when you go on it with the cursor, it wont flip to another image (rollover), it will show another image.

More detail.

I have an image and when on mouse over, a small image with transparent background shows on the other one. I want the main image to be visible too.

I dont want to use the dreamweaver roll over function, cause it adds a lot of useless code. Im making this website "light weight" as possible. Just for satisfaction :thumbsup:


Thanks in advanced

Edited by Delta16, 18 October 2009 - 07:42 AM.


BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:01:50 AM

Posted 18 October 2009 - 10:40 AM

You can't use PHP to do it because PHP runs on the server. The action you are describing takes place on the Client, and therefore needs to be done in a client side language, ie Javascript, Flash, Silverlight. I'm assuming that the code you describe as 'useless code' is actually the javascript handler, which is actually pretty important.

Javascript has a function called "addEventListener" which will add a listener to any element that you specify, for example:

element.addEventListener('mouseover',doSomething );

Where "doSomething" is a function, which for instance can be used to apply a style to an element. The CSS can do any number of things, including displaying an image of some sort.

#3 Delta16

Delta16
  • Topic Starter

  • Members
  • 417 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Malta
  • Local time:09:50 AM

Posted 18 October 2009 - 01:41 PM

Thanks for the reply.

The useless code which I was talking about is the code that some functions of dreamweaver which puts a long line, where you could get the result you want with a small line.(you know what im saying ?)

Im using CSS too, to position the images and if I put some javascript to get the result which I want, that wouldn't be a problem.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users