此主题相关图片如下:截图1224604716.jpg
很久都想要上面的那种 点击小图显示大图的组图显示方式,今天想在文章频道实现,但弄到最后,发现有个问题没有解决,希望大家帮忙,我根据下面这个代码来改系统,首先看这个代码
html文件代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<title>教师风采</title>
<script language="javascript" src="photogallery/photo00019444/sldshow.js"></script>
</head>
<body>
<img hspace="10" vspace="5" border="0" src="photogallery/photo00019444/DSC02376a.jpg" name="t1" lowsrc="照片/DSC02376a.jpg" width="100" height="75" onClick="Javascript:fp_ShowImg(document['t1'],'500','375','333',0);" style="cursor: pointer" title="学生全神贯注" align="absmiddle" />
<img hspace="10" vspace="5" border="0" src="photogallery/photo00019444/DSC02383a.jpg" name="t2" lowsrc="照片/DSC02383a.jpg" width="100" height="75" onClick="Javascript:fp_ShowImg(document['t2'],'500','375','333',0);" style="cursor: pointer" title="教师认真辅导" align="absmiddle" />
<img hspace="10" vspace="5" border="0" src="photogallery/photo00019444/DSC02377a.jpg" name="t3" lowsrc="照片/DSC02377a.jpg" width="100" height="75" title="公开课上" onClick="Javascript:fp_ShowImg(document['t3'],'500','375','333',0);" style="cursor: pointer" align="absmiddle" /><br>
<img name="fpGalleryMainImg_333" width="500" height="375" src="照片/DSC02376a.jpg" title="学生全神贯注" />
</body>
</html>
js文件代码如下:
leftdisabled = true
rightdisabled = true
widthLength = 640
function fp_ie4() {
var nav = navigator.appVersion.indexOf("MSIE");
return (nav>0) && (parseInt(navigator.appVersion.substring(nav+5, nav+6)) >= 4);
}
function fp_ns6() {
return ((navigator.appName == "Netscape") &&
(parseInt(navigator.appVersion.substring(0, 1)) >= 5))
}
function fp_ShowImg(src, sWidth, sHeight, sID, iIndex)
{
var el = document.images["fpGalleryMainImg_" + sID];
if (el) {
if(fp_ie4()) {
el.style.visiblity = "hidden";
el.src = src.getAttribute ? src.getAttribute("lowsrc") : src.lowsrc;
el.width = sWidth;
el.height = sHeight;
var caption = document.all["fpGalleryCaptions_" + sID].all.tags("div")
var sCaptionTxt;
var sCaptionHTML;
if (caption && caption[iIndex]) {
sCaptionTxt = caption[iIndex].innerText
sCaptionHTML = caption[iIndex].innerHTML
} else {
sCaptionTxt = "";
sCaptionHTML = "";
}
el.title = sCaptionTxt;
el.style.visiblity = "visible";
var el = document.all["fpGalleryCaptionCell_" + sID];
if (el) {
el.innerHTML = sCaptionHTML;
}
var el = document.all["fpGalleryDescCell_" + sID];
if (el) {
var sDesc = document.all["fpGalleryDescriptions_" + sID].all.tags("div")
el.innerHTML = sDesc && sDesc[iIndex]?sDesc[iIndex].innerHTML:"";
}
} else {
el.src = src.getAttribute ? src.getAttribute("lowsrc") : src.lowsrc
el.style.width = sWidth
el.style.height = sHeight
caption = document.getElementById("fpGalleryCaptions_" + sID).getElementsByTagName("div")
if (caption && caption[iIndex]) {
sCaptionTxt = caption[iIndex].innerText
sCaptionHTML = caption[iIndex].innerHTML
} else {
sCaptionTxt = ""
sCaptionHTML = ""
}
el.title = sCaptionTxt
var e = document.getElementById("fpGalleryCaptionCell_" + sID)
if (e) {
e.innerHTML = sCaptionHTML
}
var e = document.getElementById("fpGalleryDescCell_" + sID)
if (e) {
var sDesc = document.getElementById("fpGalleryDescriptions_" + sID).getElementsByTagName("div")
e.innerHTML = sDesc[iIndex]?sDesc[iIndex].innerHTML:""
}
}
}
}
function fp_ScrollLeft(sID) {
var el = document.all["fpGalleryListCell_" + sID];
if (el && fp_ie4()) {
var coll = el.children.tags("A");
var count = 20;
if (coll) {
for (i=1;i<coll.length;i++) {
if (coll(i).style.display != "none") {
coll(i-1).style.display = "inline";
break;
}
}
for (i=0;i<coll.length;i++) {
if (coll(i).style.display != "none") {
var images = coll[i].children.tags("img");
count = count + 20 + images[0].width;
if (count > widthLength)
coll(i).style.display = "none";
}
}
if ((el.scrollWidth - 5) >= el.clientWidth) {
var btn = document.all["fpGalleryRightBtn_" + sID]
if (btn && rightdisabled) {
rightdisabled = false;
te = btn.src
btn.src = btn.getAttribute ? btn.getAttribute("lowsrc") : btn.lowsrc
btn.lowsrc = te
}
}
if (coll(0).style.display != "none") {
var btn = document.all["fpGalleryLeftBtn_" + sID]
if (btn && !leftdisabled) {
leftdisabled = true;
te = btn.src
btn.src = btn.getAttribute ? btn.getAttribute("lowsrc") : btn.lowsrc
btn.lowsrc = te
}
}
}
}
}
function fp_ScrollRight(sID) {
var el = document.all["fpGalleryListCell_" + sID];
if (el && fp_ie4()) {
if (!rightdisabled)
{
var coll = el.children.tags("A");
if (coll) {
var state = 0;
var count = 20;
for (i=0;i<coll.length;i++) {
if (state == 0)
{
if (coll(i).style.display != "none") {
coll(i).style.display = "none";
state = 1;
}
}
else{
var images = coll[i].children.tags("img");
count = count + 20 + images[0].width;
if (count <= widthLength)
coll(i).style.display = "inline";
else
coll(i).style.display = "none";
}
}
}
var btn = document.all["fpGalleryRightBtn_" + sID];
if (btn && coll(coll.length - 1).style.display != "none") {
rightdisabled = true
te = btn.src
btn.src = btn.getAttribute ? btn.getAttribute("lowsrc") : btn.lowsrc
btn.lowsrc = te
}
var btn = document.all["fpGalleryLeftBtn_" + sID];
if (btn && leftdisabled) {
te = btn.src
btn.src = btn.getAttribute ? btn.getAttribute("lowsrc") : btn.lowsrc
btn.lowsrc = te
leftdisabled = false
}
}
}
}
找到Kesion.Label.CommonCls.asp文件1831行 在最后,参照上面的代码将代码修改为:
Content=re.replace(Content,"<img src=$2 name=$2 lowsrc=$2 style=""cursor: pointer"" alt=""点11此在新窗口浏览图片"" onclick=""Javascript:fp_ShowImg(document['$2'],'500','375','333',0);"" border=""0""/>"),现在问题就出在,因为$2出来的路径带了双引号的,document['$2']这个里的路径也就带了双引号,这样一来代码就出问题了,中括号里的不能有双引号,我也不知道怎么修改了,那位朋友能修改下,改系统文件或者js文件。
希望有人来完善下,给用科汛的朋友做个好事,时间也不早了 ,我明天看大家的消息