Floating email-this-link script

Source: Internet
Author: User

Author: etlux
Directions: insert the entire block of code below just before
The page </body> tag. See the instructions in
The script for additional setup information.
========================================================== ==================================

<! -- Begin floatmail code // -->

<SCRIPT>
/* Floating mail-this-link script c.2004 by codelifter.com */

// Insert the entire script just before the </body> tag.
// Set the following two Position Parameters
// Negative numbers are relative to right (HX) or bottom (Vy)
// Positive numbers are relative to left (HX) or (Vy) Top
// Experiment with values to get positioning exact, and allow
// For the dimensions of the Image & form in the positioning

VaR HX = 340;
VaR Vy =-140;

</SCRIPT>

<! -- Edit the HTML between the DIV tags to suit your design // -->

<Div id = "floatmail" style = "position: absolute;
Background-color: #000000;
Background-image: url('float_dots.gif ');
Width: 180px;
Border-width: 2;
Border-style: outset;
Border-color: #444444;
Padding: 5px ">
<Center>
<Form name = "emailer">
<Font size = "2" face = "verdana, Arial" color = "# ff0056">
E-mail this link
<Br>
Enter recipient's E-mail:
</Font>
<Br>
<Input type = "text" name = "Address" size = "20"
Style = "background-color: #000000;
Color: # 05fa9e;
Border-color: # ff0000;
Border-width: 1;
Border-style: dashed;
Margin-top: 7px; "> <br>
<Input type = "button" value = "send this URL" onclick = "mailthisurl ();"
Style = "color: # ff0057;
Font-family: Arial;
Font-size: 10pt;
Background-color: #000000;
Border-width: 1;
Border-style: solid;
Border-color: #242424;
Margin-top: 7px; ">
</Form>
</Center>
</Div>

<! -- End of editable HTML // -->

<SCRIPT>
/* Floating mail-this-link script c.2004 by codelifter.com */
/* Caution! Do not allow linebreaks other than where shown */
VaR good; function checkemailaddress (field ){
VaR goodemail = field. value. match (/\ B (^ (\ s + @). + ((\. com) | (\. net) | (\. edu) | (\. mil) | (\. gov) | (\. org) | (\.. {2, 2}) $) \ B/Gi );
If (goodemail) {good = true} else {alert ('Please enter a valid e-mail address .');
Field. Focus (); field. Select (); good = false ;}}
U = Window. Location; M = "I thought this might interest you ...";
Function mailthisurl () {good = false;
Checkemailaddress (document. emailer. Address );
If (good) {window. Location = "mailto:" + document. emailer. Address. Value + "? Subject = "+ M +" & Body = "+ document. Title +" "+ U ;}}
VaR nn = (navigator. appname. indexof ("Netscape ")! =-1 );
VaR dd1_document,dh1_dd.html, DB = dd. Body, PX = dd. layers? '': 'Px ';
Function floatmail (IX, Iy, ID ){
VaR L = dd. getelementbyid? Dd. getelementbyid (ID): dd. All? Dd. All [ID]: dd. Layers [ID];
This [ID + 'O'] = L; If (DD. layers) L. style = L; L. nx = L. IX = IX; L. NY = L. iy = Iy;
L. P = function (x, y) {This. style. left = x + px; this. style. top = Y + px;}; L. fm = function () {var PX, Py;
Px = (this. IX> = 0 )? 0: NN? Innerwidth: NN & DH. clientwidth? DH. clientwidth: DB. clientwidth;
Py = nn? Pageyoffset: NN & DH. scrolltop? DH. scrolltop: DB. scrolltop;
If (this. Iy <0) py + = nn? Innerheight: NN & DH. clientheight? DH. clientheight: DB. clientheight;
This. NX + =. 1 * (PX + this. iX-this.nX); this. NY + =. 1 * (PY + this. iY-this.nY); this. P (this. NX, this. NY );
SetTimeout (this. ID + 'o. FM () ', 33 );};
Return L ;}
Floatmail (HX, Vy, 'floatmail'). FM ();
</SCRIPT>

<! -- End floatmail code // -->

========================================================== ================================

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.