JS高手进,帮忙设置成默认关闭的右下角弹出广告代码 15
目前是默认展开的,想默认为缩小.代码如下:varreturnHtml="<spanclass='mini'style=\"cursor:pointer;\"><imgsr...
目前是默认展开的,想默认为缩小.代码如下:
var returnHtml = "<span class='mini' style=\"cursor:pointer;\"><img src=\"diaocha/\vote/\mini.jpg\"></span><span class='zoom' style=\"cursor:pointer;\"></span>";
returnHtml += "<div id='iframesrc'></div>";
//Download by http://www.jb51.net
$(function() {
var boxWidth = 190; //宽度,兼容IE6必写;
var boxHeight = 220; //可制空
$("#rightlayoutShow").css({width:boxWidth})
$("#rightlayoutShow").prepend(returnHtml);
$("#iframesrc").html("<iframe src=\"diaocha/\vote/\ads.html\" scrolling=\"no\" frameborder=\"0\" width=\""+boxWidth+"\" height=\""+boxHeight+"\"></iframe>");
//这里可以是Iframe Image Flash Text
$("#rightlayoutShow .mini").click(function() {
$("#iframesrc").slideUp("slow",function() {
$("#rightlayoutShow .zoom").html("<img src=\"diaocha/\vote/\guanggao.gif\">");
$("#rightlayoutShow .mini").text("");
});
$("#rightlayoutShow .zoom").css({display:"block"});
$("#rightlayoutShow .mini").css({display:"none"});
});
$("#rightlayoutShow .zoom").click(function() {
$("#iframesrc").slideDown("slow",function() {
$("#rightlayoutShow .mini").html("<img src=\"mini.jpg\">");
$("#rightlayoutShow .zoom").text("");
});
$("#rightlayoutShow .zoom").css({display:"none"});
$("#rightlayoutShow .mini").css({display:"block"});
});
$(window).scroll(function() {
callScroll("#rightlayoutShow", 10, 10 , "auto" , "absolute");
});
function callScroll(Sid, Stop, Sright, Swidth, Sposition) {
if (IEobject()) {
var scrollTop = $(window).scrollTop();
}else{
var scrollTop = $("#rightlayoutShow").scrollTop();
}
$("#rightMessage").prepend(scrollTop);
$(Sid).css({
"bottom" : - (scrollTop - Stop),
"right" : Sright,
"width" : Swidth,
"position" : Sposition
});
}
});
function IEobject() {
if (window.XMLHttpRequest) {
return true; //alert('Mozilla, Safari,IE7 ');
if(!window.ActiveXObject){
return true; //alert('Mozilla, Safari');
} else {
return true; //alert('IE7');
}
} else {
return false; //alert('IE6');
}
}
新手,没多少分有点少,解决了加分,谢谢高手了 展开
var returnHtml = "<span class='mini' style=\"cursor:pointer;\"><img src=\"diaocha/\vote/\mini.jpg\"></span><span class='zoom' style=\"cursor:pointer;\"></span>";
returnHtml += "<div id='iframesrc'></div>";
//Download by http://www.jb51.net
$(function() {
var boxWidth = 190; //宽度,兼容IE6必写;
var boxHeight = 220; //可制空
$("#rightlayoutShow").css({width:boxWidth})
$("#rightlayoutShow").prepend(returnHtml);
$("#iframesrc").html("<iframe src=\"diaocha/\vote/\ads.html\" scrolling=\"no\" frameborder=\"0\" width=\""+boxWidth+"\" height=\""+boxHeight+"\"></iframe>");
//这里可以是Iframe Image Flash Text
$("#rightlayoutShow .mini").click(function() {
$("#iframesrc").slideUp("slow",function() {
$("#rightlayoutShow .zoom").html("<img src=\"diaocha/\vote/\guanggao.gif\">");
$("#rightlayoutShow .mini").text("");
});
$("#rightlayoutShow .zoom").css({display:"block"});
$("#rightlayoutShow .mini").css({display:"none"});
});
$("#rightlayoutShow .zoom").click(function() {
$("#iframesrc").slideDown("slow",function() {
$("#rightlayoutShow .mini").html("<img src=\"mini.jpg\">");
$("#rightlayoutShow .zoom").text("");
});
$("#rightlayoutShow .zoom").css({display:"none"});
$("#rightlayoutShow .mini").css({display:"block"});
});
$(window).scroll(function() {
callScroll("#rightlayoutShow", 10, 10 , "auto" , "absolute");
});
function callScroll(Sid, Stop, Sright, Swidth, Sposition) {
if (IEobject()) {
var scrollTop = $(window).scrollTop();
}else{
var scrollTop = $("#rightlayoutShow").scrollTop();
}
$("#rightMessage").prepend(scrollTop);
$(Sid).css({
"bottom" : - (scrollTop - Stop),
"right" : Sright,
"width" : Swidth,
"position" : Sposition
});
}
});
function IEobject() {
if (window.XMLHttpRequest) {
return true; //alert('Mozilla, Safari,IE7 ');
if(!window.ActiveXObject){
return true; //alert('Mozilla, Safari');
} else {
return true; //alert('IE7');
}
} else {
return false; //alert('IE6');
}
}
新手,没多少分有点少,解决了加分,谢谢高手了 展开
1个回答
展开全部
最下面加这个试试
$("#rightlayoutShow .mini").click();
或者修改顶部的html
var returnHtml = "<span class='mini' style=\"cursor:pointer;display:none;\"></span><span class='zoom' style=\"cursor:pointer;display:block;\"><img src=\"diaocha/\vote/\guanggao.gif\"></span>";
returnHtml += "<div id='iframesrc' style=\"display:none;\"></div>";
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询