Skip to main content

Posts

Showing posts from January, 2016

Gallery Code example in Javascript

(25)Gallery  Code example in  Javascript : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Simple Photo Gallery with HTML and JavaScript</title> <style type="text/css"> body { background: #222; margin: 0; } .thumbnails img { height: 80px; border: 4px solid #555; padding: 1px; margin: 0 10px 10px 0; } .thumbnails img:hover { border: 4px solid #00ccff; cursor:pointer; } .preview img { border: 4px solid #444; padding: 1px; width: 800px; } </style> </head> <body> <div class="gallery" align="center"> <h3>Simple HTML Photo Gallery with JavaScript</h3> <div class="thumbnails"> <img onmouseover="preview.src=img1.src" name="img1" src="1.png" alt="" /> <img onmouseover="preview.src=im

zoom in & zoom out javascript code onMouseover & onMouesout example

(24)zoom in & zoom out  javascript code onMouseover & onMouesout example: <html> <BODY> <script> var nW,nH,oH,oW; function zoomToggle(iWideSmall,iHighSmall,iWideLarge,iHighLarge,whichImage) { oW=whichImage.style.width;oH=whichImage.style.height; if((oW==iWideLarge)||(oH==iHighLarge))     {     nW=iWideSmall;     nH=iHighSmall;     } else     {     nW=iWideLarge;     nH=iHighLarge;     } whichImage.style.width=nW; whichImage.style.height=nH; } </script> <table >  <tr>  <td >         <img border="0"  src="1.png" width="100" height="100" onMouseOut="zoomToggle('100px','100px','200px','200px',this);"  onMouseOver="zoomToggle('300px','300px','400px','400px',this);" >  <br>  </td>  </tr>  </table> </body> </html> (25)Gallery  Code example in  Javascript : <!DOCTYPE html PUBLI

JAVA-SCRIPT FORM HANDLING

(22)addition of two number using form using JavaScript : n1<input type = "number" id = "n1" value=15 /> n2<input type = "number" id = "n2" value=20 /> <p>Sum?</p> <button onclick="sum()">Try it</button> <p id="demo2">Result?? </p> <script type="text/javascript">  function sum() {     var fn, ln;     fn = parseInt(document.getElementById("n1").value);     ln = parseInt(document.getElementById("n2").value);     result =  (fn+ln);     document.getElementById("demo2").innerHTML = result; } </script> Another example for addition  using name  of  field  using  parseInt() function : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head&g