Сообщение от chinga
|
возможно jquery.
|
при чём оно тут?
скрипт находится где-то тут. вероятно, в showPopup заложены действия, вам необходимые
var outsider = navigator.userAgent.match(/.*MSIE 6.0.*/i);
$(document).ready(function(){
santa();
indexpic();
metka();
plenka();
bindPopup();
});
var myDate=new Date()
var timer=null;
var timer_hover=null;
var current = null;
var prev = null;
var stop_popup = 0;
var show_circle_count = 0;
var big_popup_link = null;
var cls = 'ip_1';
function metka_hov(th){
var ctext = " ";
var cpic = " ";
$(".mbubble").removeClass("mbright");
ctext = $(th).parents(".metka").find(".popup_content .pc_text").html();
cpic = $(th).parents(".metka").find(".popup_content .pc_pic").html();
$(".mbubble .mbubblecnt .bpic").html("<img src='"+cpic+"' />");
$(".mbubble .mbubblecnt .bdescr").html(ctext);
big_popup_link = $(th).parents(".metka").find("a.mlink");
$(".mbubble .mbubblecnt .bpic img").click(function (){
if (big_popup_link != null){
big_popup_link.click();
}
});
$(".mbubble .mbubblecnt .bpic img").css('cursor', 'pointer');
var off = $(th).offset();
var w=$(".mbubble").width();
var t = off.top+$(th).height()+5;
var l = off.left+$(th).width()+5;
var ww = $(window).width();
if((w+l)>ww) {
l=l-w-$(th).width()+10;
$(".mbubble").toggleClass("mbright");
}
$(".mbubble").css("margin-top",t+"px");
$(".mbubble").css("margin-left",l+"px");
//$(".mbubble").show();
$(".mbubble").fadeIn("slow");
// $(".mbubble").css("display","block");
}
function metka_out() {
if (stop_popup == 0) {
$(".mbubble").css("display","none");
}
}
function metka(){
$(".indxpic .metka a.mlink").hover(function(){
stop_popup = 1;
//clearTimeout(timer);
clearTimeout(timer_hover);
metka_hov(this);
},function(){
timer_hover = setTimeout('stop_popup = 0;metka_out();/*if (stop_popup == 1){stop_popup = 0;}*/', 500);
});
$(".mbubble").hover(function(){
clearTimeout(timer_hover);
timer_hover = 0;
$(".mbubble").css("display","block");
},function(){
metka_out();
});
$(".indxpic .metka a.mlink").click(function(){
stop_popup = 2;
if ((prev != null) && prev.length > 0){
var metka = $('.mlink', prev.parent());
if (metka.length>0){
metka_out(metka);
}
}
ltext = $(this).parents(".metka").find(".layer_content .lc_text").html();
lpic = $(this).parents(".metka").find(".layer_content .lc_pic").html();
$(".mlayer .mlayer_content").html(ltext);
$(".mlayer .ml_pic").html("<img src='"+lpic+"' />");
$(".mlayer").css("display","block");
$(".mlayer").css("width","1063px");
$(".mlayer").css("height","495px");
});
$(".mlayer .close a").click(function(){
$(".mlayer").css("display","none");
if (stop_popup == 2){
setTimeout('stop_popup = 0', 500);
}
});
}
function showPopup(){
//alert(show_circle_count);
if (show_circle_count<0)
return;
if ((stop_popup != 0)){
timer = setTimeout('showPopup()', 100);
return;
}
if ((prev != null) && prev.length > 0){
var metka = $('.mlink', prev.parent());
if (metka.length>0){
metka_out(metka);
}
}
if (current == null){
var cnt = show_circle_count;
if (cnt <= 0){
clearTimeout(timer);
return;
}else{
// section.attr('round_count', cnt);
current = $('.indxpic .indxpicdiv .'+cls+' .popup_content:first');
}
}
if (current == null){
clearTimeout(timer);
return;
}
var timeout = current.attr('timeout');
if (!timeout){
timeout = 1000;
}
var metka = $('.mlink', current.parent());
if (metka.length>0){
//debugger;
metka_hov(metka);
prev = current;
var tmp = $('+ div.metka .popup_content', current.parent());
current = tmp;
if (current.length<1){
current = null;
}
}
timer = setTimeout('showPopup()', timeout);
}
function bindPopup(){
current = $('.indxpic .indxpicdiv .ip_act .popup_content:first');
show_circle_count = $('.indxpic .indxpicdiv .'+cls).attr('round_count');
$(".mbubble").hover(function(){
stop_popup = 1;
},function(){
stop_popup = 0;
});
var timer=setTimeout('showPopup()', 500);
}
function indexpic(){
if($(".indxpic .ipicture").length>0){
src = $(".indxpic .ipicture").html();
$(".contbody").css("background", "url("+src+") left bottom no-repeat #fff");
}
}