Sunday, 22 May 2011

Learn PHP online : PHP Day-33

Event onMouseover onMouceout

                                          

Event: Event is an action of a controlee. If you want to execute any functionality based on the action perform on a controlee, we are using event attributes.
Every controlee is providing number of attributes.  
Ex: onclick, onmouse over, onmouseout.
Note: What statements we are including with image attributes that comes under Java Script statements.
Sample Script:
<img src="file:///F|/Demo/1.jpg" onClick="src='file:///F|/Demo/2.JPG'" onMouseOver="src='file:///F|/Demo/3.jpg'" onMouseOut="src='file:///F|/Demo/1.jpg'">
Save this script with .html extension. And the place of red mark, please provide URL of your image which is located in your system.
Sample Script:
<img src="file:///F|/Demo/1.jpg" width="600" id="k" />
<br />
<img src="file:///F|/Demo/2.JPG" width="200" onClick="k.src='file:///F|/Demo/2.JPG'">
<img src="file:///F|/Demo/3.JPG" width="200" onClick="k.src='file:///F|/Demo/3.JPG'">
<img src="file:///F|/Demo/4.JPG" width="200" onClick="k.src='file:///F|/Demo/4.JPG'">
Save this script with .html extension. And the place of red mark, please provide URL of your image which is located in your system. This script works in only Internet Explore.

Sample Script:
<a href = "http://www.danphp.com" style="font-size:'30'"
onMouseover="style.fontSize='50';style/textDecoration='none';style.color='red'"
onMouceout='underline';style.color='blue'">HTML Notes</a>
Save this script with .html extension.

No comments:

Post a Comment

Visual comparison of the two methods, creating a simple table.

Option 1, using PHP: // PHP $html = '<table>' ;     foreach ( $data as $row ) {     $html .= '<tr>...