Friday, March 4, 2011

Want to Display your Name in heart shape


If you want to display your name in heart shape  then you have to use code of java script given below and an html code
Inception (Two-Disc Edition) [Blu-ray]
First java code  save this file by the name of heart.js
Code is :
function createHeart(sourceId, resultId) {
    objSource = window.document.getElementById(sourceId);
    objResult = window.document.getElementById(resultId);

    if(objSource.value.length == 0) {
        alert("Vikas Gautam Says Enter  Your name in the Text Box!");
        return false;
    }

    string = objSource.value;

    heart = "";
    heart = ". [red][b] \n";
    heart += "_________"               + partString(string, 8)  + "____________" + partString(string, 9)  + "\n";
    heart += "______"                  + partString(string, 14) + "_______"      + partString(string, 16) + "\n";
    heart += "____"                    + partString(string, 19) + "___"          + partString(string, 19) + "\n";
    heart += "___"                     + partString(string, 32) + "_______"      + partString(string, 4)  + "\n";
    heart += "__"                      + partString(string, 32) + "_________"    + partString(string, 4)  + "\n";
    heart += "_"                       + partString(string, 36) + "_______"      + partString(string, 4)  + "\n";
    heart += "_"                       + partString(string, 40) + "______"       + partString(string, 1)  + "\n";
    heart +=                             partString(string, 44) + "__"           + partString(string, 3)  + "\n";
    heart +=                             partString(string, 47) + "_"            + partString(string, 1)  + "\n";
    heart +=                             partString(string, 49)                                           + "\n";
    heart +=                             partString(string, 49)                                           + "\n";
    heart += "_"                       + partString(string, 47)                                           + "\n";
    heart += "__"                      + partString(string, 45)                                           + "\n";
    heart += "____"                    + partString(string, 42)                                           + "\n";
    heart += "______"                  + partString(string, 37)                                           + "\n";
    heart += "_________"               + partString(string, 31)                                           + "\n";
    heart += "____________"            + partString(string, 25)                                           + "\n";
    heart += "______________"          + partString(string, 20)                                           + "\n";
    heart += "_________________"       + partString(string, 13)                                           + "\n";
    heart += "___________________"     + partString(string, 9)                                            + "\n";
    heart += "_____________________"   + partString(string, 6)                                            + "\n";
    heart += "______________________"  + partString(string, 4)                                            + "\n";
    heart += "_______________________" + partString(string, 2)                                            + "\n";
    heart += "create by hack2007.50webs.com";


    objResult.value = heart;
}
function partString(string, num) {
    if(string.length >= num)
        return string.substring(0, num);

    repeat = Math.ceil(num / string.length);

    newString = "";

    for(i = 0; i < repeat; i++)
        newString += string;

    return newString.substring(0, num);
}
HDMI Cable 2M (6 Feet)
After saving this file you need to create  an html file  by which you able to chage your name in heart shape
Name this file as you want   and past this code to this file and save it
<html>
<table align=”center” bgcolor=”green”>
 <tr>
                    <td width="100%" height="74" align="left" valign="top">
      <p style="margin-top: 0; margin-bottom: 0; line-height:150%">
      <font face="Georgia" style="font-size: 11pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      Vikas Gautam  Says Enter   your name </font></p>

      <p style="margin-top: 0; margin-bottom: 0; line-height:150%">
      <font face="Georgia" style="font-size: 11pt">&nbsp;&nbsp;
      <input id="text" name="text" size="20">
                      <input class="button" accesskey="g" onclick="return createHeart('text', 'result');" value=" Heart" type="button"> </font></p>
      <p style="margin-top: 0; margin-bottom: 0; line-height:150%">
      <font face="Georgia" style="font-size: 11pt">
                      <br>
                      <textarea id="result" rows="17" cols="57" onclick="this.focus(); this.select();" readonly="readonly"></textarea>

                                                              <script src="heart.js"></script></font></p>
                    </td>
                  </tr>
                </table>
                </html>
AmazonBasics High Speed HDMI Cable (6.5 Feet / 2.0 Meters) - Supports Ethernet, 3D, and Audio Return [NEW MODEL]
Now you run the html file in html browser  and enter  your name in the text box and click on the  create  heart  button.

No comments:

Post a Comment