Jump to content

Onmouseover


dsinghldh

Recommended Posts

<style type="text/css">

.mysmallpic {
width:50px;
height:50px;
}

.mybigpic {
width:500px;
height:400px;
}

</style>

<script language="javascript">

function enlarge(pic) {
document.getElementById(pic).className="mybigpic";
}

function normal(pic) {
document.getElementById(pic).className="mysmallpic";
}

</script>

<img id="pic1" class="mysmallpic" src="" onmouseover="enlarge(this.id)" onmouseout="normal(this.id)">

Link to comment
https://forums.phpfreaks.com/topic/85929-onmouseover/#findComment-438719
Share on other sites

Hello and welcome to the forums.

Please make yourself familiar with the forum guidelines, and carefully read the board descriptions BEFORE posting a new topic. @phpfreaks is for questions regarding this site, not your own issues.

 

as for your question, it has nothing to do with PHP as it's a client-side issue. you can probably achieve it with pure CSS as an alternative to the Javascript one suggested by phpQuestioner.

 

.image {
  width:75px;
  height:75px;
}
.image:hover {
   width:120px;
   height:120px;
}

 

although (not sure if still the case) i believe some browsers don't like :hover on anything other than regular links. some CSS-only tricks dealing with this sort of things can be found here: http://www.cssplay.co.uk

Link to comment
https://forums.phpfreaks.com/topic/85929-onmouseover/#findComment-438762
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.