Tartanneil
07-05-2011, 04:17 PM
I'm running this script for a tooltip slideshow:
var tooltipshow = {
init: function(id, category, effects){
this.id = $("#" + id);
this.category = category;
this.effects = effects;
this.speed = effects.speed || 500;
var me = this;
$("#" + id + " a").each(function(){
$(this).hover(
function(){
me.createToolTip(me.category[$(this).data("category")]);
},
function(){
me.tooltip.remove();
me.currimg = 0;
clearTimeout(me.counter);
});
});
return this; //pass this to the init caller variable;
},
createToolTip: function(category){
this.tooltip = $("<div></div>")
.addClass("tip");
this.images = new Array();
var me = this;
$.each(category, function(key, value){
me.images[key] = $("<img></img>")
.attr({
src: value,
width: 50,
height: 50
});
me.tooltip.append(me.images[key]);
});
$(document).mousemove(function(e){
var x = (e.pageX || e.clientX + document.body.scrollLeft) + 10;
var y = (e.pageY || e.clientY + document.body.scrollTop) + 10;
me.tooltip.css({
top: y + "px",
left: x + "px"
});
});
$("body").append(this.tooltip);
this.currimg = 0; // the current image
this.counter = setTimeout(function(){ me.slideshow(); }, this.speed);
},
slideshow: function(){
this.images[this.currimg].animate({'opacity': 0}, 500);
this.images[(this.currimg+1 > this.images.length-1) ? 0 : this.currimg+1].animate({'opacity': 1}, 500);
this.currimg++;
if(this.currimg > this.images.length-1){
this.currimg = 0;
}
var me = this;
this.counter = setTimeout(function(){ me.slideshow(); }, this.speed+500);
}
}
The tooltip slideshow also requires a second script that is stored here (http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js).
Somewhere in the tooltip scripts there is a conflict with the Lightbox Image Viewer 2.03a (http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm) causing the viewer to stop working when the tooltip scripts are installed. Can anyone help me solve the issue?
Thanks in advance
var tooltipshow = {
init: function(id, category, effects){
this.id = $("#" + id);
this.category = category;
this.effects = effects;
this.speed = effects.speed || 500;
var me = this;
$("#" + id + " a").each(function(){
$(this).hover(
function(){
me.createToolTip(me.category[$(this).data("category")]);
},
function(){
me.tooltip.remove();
me.currimg = 0;
clearTimeout(me.counter);
});
});
return this; //pass this to the init caller variable;
},
createToolTip: function(category){
this.tooltip = $("<div></div>")
.addClass("tip");
this.images = new Array();
var me = this;
$.each(category, function(key, value){
me.images[key] = $("<img></img>")
.attr({
src: value,
width: 50,
height: 50
});
me.tooltip.append(me.images[key]);
});
$(document).mousemove(function(e){
var x = (e.pageX || e.clientX + document.body.scrollLeft) + 10;
var y = (e.pageY || e.clientY + document.body.scrollTop) + 10;
me.tooltip.css({
top: y + "px",
left: x + "px"
});
});
$("body").append(this.tooltip);
this.currimg = 0; // the current image
this.counter = setTimeout(function(){ me.slideshow(); }, this.speed);
},
slideshow: function(){
this.images[this.currimg].animate({'opacity': 0}, 500);
this.images[(this.currimg+1 > this.images.length-1) ? 0 : this.currimg+1].animate({'opacity': 1}, 500);
this.currimg++;
if(this.currimg > this.images.length-1){
this.currimg = 0;
}
var me = this;
this.counter = setTimeout(function(){ me.slideshow(); }, this.speed+500);
}
}
The tooltip slideshow also requires a second script that is stored here (http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js).
Somewhere in the tooltip scripts there is a conflict with the Lightbox Image Viewer 2.03a (http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm) causing the viewer to stop working when the tooltip scripts are installed. Can anyone help me solve the issue?
Thanks in advance