Click to See Complete Forum and Search --> : How to make my own COMODO bottom right hover over image?


fast09
January 24th, 2009, 10:11 AM
I am looking for the script which COMODO uses for their SSL certifcate. which keeps a IMAGE hovered over the bottom right of the webpage, and it stays in place as you scroll your website.

How can someone write their own script?
using there own images, and also how can you create that HOVER OVER image which COMODO uses when you place your mouse over the HOVERIMAGE (THE POPUP SSL CERTIFICATE)


example here
http://www.trustlogo.com/ssl-certificate-support/



any support would be cool to know, thanks

PeejAvery
January 24th, 2009, 11:53 AM
All you have to do is use the onscroll event and reset the Y coordinate when that event is fired.

fast09
January 24th, 2009, 02:08 PM
All you have to do is use the onscroll event and reset the Y coordinate when that event is fired.

sorry i should have said NEWBIE in posting... really dont understand the terms u use.

I have come across..
==================================================
adiWidget™ is the static image to be put at the corner of your web.
http://adiwidget.blogspot.com/search/label/--Get%20Codes--
==================================================
the above Widget uses their own URL once i use there code, but i would need my own
js file i guess, and my own script. to display a static image "bottom right" of the browser.
so i would like to figure out how to do this with my own URL placed in the code, and if possible
when my mouse hovers over that image, to display a pop up image as well... just like COMODO does..


another site i found was
==================================
Site Logo Script (a.k.a Geocities Watermark)
http://www.dynamicdrive.com/dynamicindex4/logo.htm
========================================
but not the script i was looking for...



if u know a script that i can use, would be very useful,..
thanks for replying..

fast09
January 25th, 2009, 12:57 AM
Found the following website and used the following code and .js file

staticlogo.js (Lower right corner logo)

==================================================================
http://www.jsmadeeasy.com/javascripts/Image%20Effects/Site%20Logo%20Script/index.htm
==================================================================

only problem, this script is no where like the comodo, the script flickers when scrolling,
looks very bad... and does not work in firefox only IE..


does anyone know of the correct .js file and html code to use?
I am looking for the COMODO VERSION... the best one out there
that doesn't flicker when you scroll the webpage.. and fix perfectly.

PeejAvery
January 25th, 2009, 01:27 PM
You can edit the flickering by changing the interval of updating.

http://www.howtocreate.co.uk/jslibs/script-staticlogo

PeejAvery
January 25th, 2009, 06:44 PM
Wow, I have not been thinking. Rather than using JavaScript, you should implement CSS. It will be smaller code, no flickering, and no extra CPU processing.

#logo {
position: absolute;
bottom: 0px;
left: 0px;
}

If you want to position it in a different X coordinate, you will have to set it using JavaScript.

document.getElementById('logo').style.left = amount + 'px';

fast09
January 26th, 2009, 12:26 AM
Thank Peej...

I dont know to much about the script u had provided nor coding newbie but learn quick..

this is what i end up using..


Following Scirpts Steps 1 and 2 are placed first..
than place Step 3 after Step 2 b4 the closing tags
///</body>
///</html>


<H1> SCRIPT USED FOR LINKED IMAGE</H1><br>
see below for <b>BOTTOM RIGHT IMAGE SCRIPT</b>

=================================================
Step 1: Insert the below script into the <head> section of your page:
///from this website
///http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm

STEP 1

<script type="text/javascript">

/***********************************************
* Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
* Copyright 2002-2007 by Sharon Paine
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* IMPORTANT: Put script after tooltip div or
put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;

var origWidth, origHeight;

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

/////////////////////// CUSTOMIZE HERE ////////////////////
// settings for tooltip
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 160;
var offX= 20; // how far from mouse to show tip
var offY= 12;
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF";
var tipBorderColor= "#000080";
var tipBorderWidth= 3;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing:
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
messages[0] = new Array('red_balloon.gif','Here is a red balloon on a white background',"#FFFFFF");
messages[1] = new Array('duck2.gif','Here is a duck on a light blue background.',"#DDECFF");
messages[2] = new Array('test.gif','Test description','black','white');

//////////////////// END OF CUSTOMIZATION AREA ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
var theImgs = new Array();
for (var i=0; i<messages.length; i++) {
theImgs[i] = new Image();
theImgs[i].src = messages[i][0];
}
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
// initTip - initialization for tooltip.
// Global variables for tooltip.
// Set styles
// Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
if (nodyn) return;
tooltip = (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
tipcss = tooltip.style;
if (ie4||ie5||ns5) { // ns4 would lose all this on rewrites
tipcss.width = tipWidth+"px";
tipcss.fontFamily = tipFontFamily;
tipcss.fontSize = tipFontSize;
tipcss.color = tipFontColor;
tipcss.backgroundColor = tipBgColor;
tipcss.borderColor = tipBorderColor;
tipcss.borderWidth = tipBorderWidth+"px";
tipcss.padding = tipPadding+"px";
tipcss.borderStyle = tipBorderStyle;
}
if (tooltip&&tipFollowMouse) {
document.onmousemove = trackMouse;
}
}

window.onload = initTip;

/////////////////////////////////////////////////
// doTooltip function
// Assembles content for tooltip and writes
// it to tipDiv
/////////////////////////////////////////////////
var t1,t2; // for setTimeouts
var tipOn = false; // check if over tooltip link
function doTooltip(evt,num) {
if (!tooltip) return;
if (t1) clearTimeout(t1); if (t2) clearTimeout(t2);
tipOn = true;
// set colors if included in messages array
if (messages[num][2]) var curBgColor = messages[num][2];
else curBgColor = tipBgColor;
if (messages[num][3]) var curFontColor = messages[num][3];
else curFontColor = tipFontColor;
if (ie4||ie5||ns5) {
var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
tipcss.backgroundColor = curBgColor;
tooltip.innerHTML = tip;
}
if (!tipFollowMouse) positionTip(evt);
else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
// positionTip function
// If tipFollowMouse set false, so trackMouse function
// not being used, get position of mouseover event.
// Calculations use mouseover event position,
// offset amounts and tooltip width to position
// tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
if (!tipFollowMouse) {
standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
}
// tooltip width and height
var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
// document area in view (subtract scrollbar width for ns)
var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
// check mouse position against tip and window dimensions
// and position the tooltip
if ((mouseX+offX+tpWd)>winWd)
tipcss.left = mouseX-(tpWd+offX)+"px";
else tipcss.left = mouseX+offX+"px";
if ((mouseY+offY+tpHt)>winHt)
tipcss.top = winHt-(tpHt+offY)+"px";
else tipcss.top = mouseY+offY+"px";
if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
if (!tooltip) return;
t2=setTimeout("tipcss.visibility='hidden'",100);
tipOn = false;
}

document.write('<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>')

</script>



In Step 1: do the following....

//////////////////// CUSTOMIZATION HERE ///////////////////
// settings for tooltip
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 300; ///////////////////////////////// ADJUST YOUR IMAGE WIDTH SIZE HERE
var offX= 20; // how far from mouse to show tip
var offY= 12;
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF";
var tipBorderColor= "#080808";
var tipBorderWidth= 1;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing:
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
messages[0] = new Array('images/YOUR POP UP IMAGE LIKE COMODO.gif','Write Your Text Below this POPUP Image HERE',"#DDECFF");

/////#DDECFF << this is a light blue background color, very nice for this use.


//////////////////// END OF CUSTOMIZATION AREA ///////////////////


Step 2: Then, set up your links to contain the necessary onMouseover and out attributes. Use the following code as an example, where 0 and 1 refer to the image tooltip's index number in the script above that you wish to invoke :


<a href="#" onmouseover="doTooltip(event,0)" onmouseout="hideTip()">>Link 1</a>
<a href="#" onmouseover="doTooltip(event,1)" onmouseout="hideTip()">Link 2</a>



<b>So what i did was changed STEP 2 into this code: using only 1 line code,
no need for Link 2, REMOVE THIS LINE</b>
STEP 2 " USE ONLY THIS CODE - EDIT WITH YOUR IMAGE CODE"

<a href="#" onmouseover="doTooltip(event,0)" onmouseout="hideTip()"><img src="images/bottom right image file here.gif"<br>




STEP 3
BOTTOM RIGHT FIXED IMAGE


</script>
<div style="
height:120%;
width:90%;">
<a href="" onmouseover="doTooltip(event,0)" onmouseout="hideTip()"><img src="images/YOUR IMAGE U WANT TO HOVER BOTTOM RIGHT CORNER.gif"
style="position:fixed; //// FIXED VERY IMPORTANT.
float:right;
right:0px;
bottom:0px;
z-index:2;">

</div>



HOPE THIS HELPS, the script STEP 3 for some reason in IE doesnt display correctly as it should, and the pop up image ends up being displayed below the BOTTOM CORNER IMAGE, but this script works great in FIREFOX! and thats whats most important!!!! FIREFOX #1

;)

fast09
January 26th, 2009, 12:31 AM
THE ONLY THING I CAN'T FIGURE OUT YET!

is how to remove the da*n border around my BOTTOM RIGHT IMAGE
i would like to remove it since the image i made is transparent background
and is oval in shape, so now i have all this nice beautiful work, but i got a border
going around the darn bottom right image.


THE FOLLOWING LINE OF CODE


var tipFontColor= "#000000";
var tipBgColor= "#DDECFF";
var tipBorderColor= "#080808";
var tipBorderWidth= 1;
var tipBorderStyle= "ridge"; //////////////////////// HOW TO REMOVE THE DA*N BORDER! ??
var tipPadding= 4;

fast09
January 26th, 2009, 12:46 AM
NOW THE LAST PART OF MAKING THIS SCRIPT....
====================================

How to call the script from a .js or .css file ???
So i can keep the code clean and not appear in my view source.

How do i get the code above shown here or above this forum

http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm

into a .js or .css script that can be called from the page html/php itself?
I know how to use notepad, save as .js, or .css , but how can i get this all to work together?
for now everything works great, but i would like to call the script into action, and not have it
displayed in my VIEW SOURCE...


This is the call .JS script COMODO uses

<script language="JavaScript" src="https://secure.comodo.net/trustlogo/javascript/trustlogo.js" type="text/javascript">
</script>



thanks...

PeejAvery
January 26th, 2009, 09:01 AM
Ignore the script I posted. Did you not read my last post?

fast09
January 26th, 2009, 12:13 PM
Wow, I have not been thinking. Rather than using JavaScript, you should implement CSS. It will be smaller code, no flickering, and no extra CPU processing.

#logo {
position: absolute;
bottom: 0px;
left: 0px;
}

If you want to position it in a different X coordinate, you will have to set it using JavaScript.

document.getElementById('logo').style.left = amount + 'px';



alright so this code will i still be able to display a mouse over using this code..
I currently have the bottom right image fixed and working fine, and also have the
onmouse over image POPUP once the mouse is hovered over, only thing is to try to
make the code not visible in my view source and also to get rid of the BORDER that
is now wrapped around my static bottom right image, becuase of the HOVER-POPUP IMAGE linked to it...


the following code
#logo {
position: absolute;
bottom: 0px;
left: 0px;
}
where is this placed? in a .css file? or in the html/php itself

and the same with this code, where is this placed?
document.getElementById('logo').style.left = amount + 'px';[/QUOTE]



thanks

PeejAvery
January 26th, 2009, 01:32 PM
Using the even onmouseover will go within the <img> tag. The CSS would be placed in .css file, or in <style> tags of text/css type. And the JavaScript would go in a .js file, or inside of <script> tags of the text/javascript type.

fast09
January 29th, 2009, 02:07 AM
thanks peej, Right now the script is working, but only shows up in firefox correctly as it should, but in IE the da*m static images doesnt load to the bottom right, instead just a few inches off from it, and the hover onmouseover loads on the other side (left side of the bottom window)

I really dont understand why there isnt a standard when it comes to display code on their types of browsers, anywhos so looks ok in firefox, but messes up in IE..

last thing, is that da*m BOARDER, keeps appearing around my static image, i dont want that boarder.... I have set it to 0 and still the da*m displays..

anyways life of an unguru i guess ;)

thanks again peej

PeejAvery
January 29th, 2009, 08:36 AM
You have to remember that not all browsers interpret CSS in the exact same way. Are you declaring your doctype properly? Are you using transitional?