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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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