PageSourceSearch

https://utrocketsjersey.com/includes/templates/classic/jscript/jscript_imagehover.js

js utrocketsjersey.com collected 2026-10-08 17:32:30 UTC 7,858 bytes, 209 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opens = _____WB$wombat$assign$function_____("opens");
10/*
11Simple Image Trail script- By JavaScriptKit.com
12Visit http://www.javascriptkit.com for this script and more
13This notice must stay intact
14 
15Simple Image Trail script- By JavaScriptKit.com was originally modified by Tim Kroeger ([email protected])
16for use with Image Handler 2 and better cross browser functionality
17 
18Later the Simple Image Trail script- By JavaScriptKit.com was further modified by
19[email protected] in an attempt to  fix ie 6 issues see zencart forum IH2 thread
20for detials
21 
22Image Handler Jscript
23Version 4.3
24Modified by Nigel Thomson ([email protected]) 12 June 2010
25This  modified version of the Simple Image Trail script- By JavaScriptKit.com (4.1) brings in Opera
26support, and fixes the webkit (Safari and Chrome) Bugs
27Fix for horizontalscrollbar added 23 june 2010
28http://nigeltsblog.blogspot.com/2010/06/zencart-image-handler-webkit-and-opera.html
29Fix for IE9 added 16 March 2011
30http://nigeltsblog.blogspot.com/2011/03/image-handler-and-internet-explorer-9.html
31*/
32 
33var offsetfrommouse=[10,10]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
34var displayduration=0; //duration in seconds image should remain visible. 0 for always.
35var currentimageheight = 400;    // maximum image size.
36var padding=10; // padding must by larger than specified div padding in stylessheet
37 
38// Global variables for sizes of hoverimg
39// Defined in "showtrail()", used in "followmouse()"
40var zoomimg_w=0;
41var zoomimg_h=0;
42var vpos;
43//Detect IE
44var stIsIE = /*@cc_on!@*/false;
45//detect opera
46var isOpera =
47window.opera?1:0;
48// Detect Webkit browsers
49var isWebKit =
50navigator.userAgent.indexOf("AppleWebKit") > -1;
51 
52if (document.getElementById || document.all){
53document.write('<div id="trailimageid">');
54document.write('</div>');
55}
56 
57function getObj(name) {
58if (document.getElementById) {
59this.obj = document.getElementById(name);
60this.style = document.getElementById(name).style;
61} else if (document.all) {
62this.obj = document.all[name];
63this.style = document.all[name].style;
64} else if (document.layers) {
65this.obj = document.layers[name];
66this.style = document.layers[name];
67}
68}
69 
70function gettrail(){
71return new getObj("trailimageid");
72}
73 
74function truebody(){
75if (isWebKit){
76return document.body;
77}else if (isOpera) {
78return document.documentElement;
79}else{
80 
81return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
82}
83}
84 
85function showtrail(imagename,title,oriwidth,oriheight,zoomimgwidth,zoomimgheight, image, startx, starty, startw, starth){
86zoomimg_w=zoomimgwidth;
87zoomimg_h=zoomimgheight;
88if (zoomimgheight > 0){ currentimageheight = zoomimgheight; }
89trailobj = gettrail().obj;
90trailobj.style.width=(zoomimgwidth+(2*padding))+"px";
91trailobj.style.height=(zoomimgheight+(2*padding))+"px";
92trailobj.setAttribute("startx", startx);
93trailobj.setAttribute("starty", starty);
94trailobj.setAttribute("startw", startw);
95trailobj.setAttribute("starth", starth);
96trailobj.setAttribute("imagename", imagename);
97trailobj.setAttribute("imgtitle", title);
98document.onmousemove=followmouse;
99}
100 
101function hidetrail(){
102trailstyle = gettrail().style;
103trailstyle.visibility = "hidden";
104document.onmousemove = "";
105trailstyle.left = "-2000px";
106trailstyle.top = "-2000px";
107}
108 
109function followmouse(e){
110 
111var xcoord=offsetfrommouse[0];
112var ycoord=offsetfrommouse[1];
113if (stIsIE){
114var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15;
115var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight);
116}
117else
118{
119var docwidth=pageXOffset+window.innerWidth-15;
120var docheight=Math.min(window.innerHeight);
121 
122}
123var relativeX = null;
124var relativeY = null;
125if ((typeof e != "undefined") && !(stIsIE)){ // This forces IE9 to go to the else option
126if ((typeof e.layerX != "undefined") && (typeof e.layerY != "undefined")) {
127relativeX = e.layerX;
128relativeY = e.layerY;
129} else if ((typeof e.x != "undefined") && (typeof e.y != "undefined")) {
130//      relativeX = e.x; // original code replaced to work with Opera
131//      relativeY = e.y; // original code replaced to work with Opera
132relativeX = event.offsetX;
133relativeY = event.offsetX;
134}
135if (docwidth - e.pageX < zoomimg_w + (3 * padding)) {
136xcoord = e.pageX - xcoord - zoomimg_w - (2 * offsetfrommouse[0]);
137} else {
138xcoord += e.pageX;
139}
140if (docheight - e.pageY < zoomimg_h + (2 * padding)){
141ycoord += e.pageY - Math.max(0,(0 + zoomimg_h + (5 * padding) + e.pageY - docheight - truebody().scrollTop));
142// returning different values for ff and (opera and webkit) - fixed 12th june 2010
143} else {
144ycoord += e.pageY;
145}
146 
147} else if (typeof window.event != "undefined"){ // This works for IE
148 
149if ((typeof event.x != "undefined") && (typeof event.y != "undefined")) {
150relativeX = event.x;
151relativeY = event.y;
152}
153else if ((typeof event.offsetX != "undefined") && (event.offsetY != "undefined")) {
154relativeX = event.offsetX;
155relativeY = event.offsetY;
156}
157 
158if (docwidth - event.clientX < zoomimg_w + (3 * padding)) {
159xcoord = event.clientX - xcoord - zoomimg_w - (2 * offsetfrommouse[0]);
160} else {
161xcoord += truebody().scrollLeft+event.clientX;
162}
163/* event.clientY is not valid in firefox netscape or opera, but ie has to use it */
164var ie_offset = -20;
165if ( docheight - event.clientY < zoomimg_h + (2 * padding) ){
166/*
167ycoord += event.clientY - Math.max(0,(0 + zoomimg_h + (5 * padding) - (docheight + truebody().scrollTop -event.clientY) ) );
168*/
169ycoord += ie_offset + truebody().scrollTop + event.clientY - Math.max(0,(0 + zoomimg_h + (2 * padding) - (docheight - event.clientY) ) );
170} else {
171ycoord += ie_offset + truebody().scrollTop + event.clientY;
172}
173}
174 
175trail = gettrail();
176startx    = trail.obj.getAttribute("startx");
177starty    = trail.obj.getAttribute("starty");
178startw    = trail.obj.getAttribute("startw");
179starth    = trail.obj.getAttribute("starth");
180imagename = trail.obj.getAttribute("imagename");
181title     = trail.obj.getAttribute("imgtitle");
182 
183// calculate and set position BEFORE switching to visible
184if (stIsIE){
185var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-1
1855;
186var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight);
187}else{
188var docwidth=pageXOffset+window.innerWidth-15;
189var docheight=Math.max(document.body.offsetHeight, window.innerHeight);
190}
191 
192if(ycoord < 0) { ycoord = ycoord*-1; }
193if ((trail.style.left == "-2000px") || (trail.style.left == "")) { trail.style.left=xcoord+"px"; }
194if ((trail.style.top == "-2000px") || (trail.style.top == "")) { trail.style.top=ycoord+"px"; }
195trail.style.left=xcoord+"px";
196trail.style.top=ycoord+"px";
197 
198if (trail.style.visibility != "visible") {
199if (((relativeX == null) || (relativeY == null)) ||
200((relativeX >= startx) && (relativeX <= (startx + startw))
201&& (relativeY >= starty) && (relativeY <= (starty + starth)))){
202newHTML = '<div><h1>' + title + '</h1>';
203newHTML = newHTML + '<img src="' + imagename + '"></div>';
204trail.obj.innerHTML = newHTML;
205trail.style.visibility="visible";
206}
207}
208}
209}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.