我为图像导航编写了这段代码:
function buttons(){
if($("#1").is(":visible")){
$("#prev").hide();
}else{
$("#prev").show();
}
if($("#<?php echo $anzahl; ?>").is(":visible")){
$("#next").hide();
}else{
$("#next").show();
}
}
buttons();
function next(){
var firstvisible = $(".thumbprofilpic:visible:first").attr("id");
var lastvisible = $(".thumbprofilpic:visible:last").attr("id");
var shownextpic = parseInt(lastvisible) + 1;
var hideprevpic = parseInt(firstvisible);
$('#' + hideprevpic).hide();
$('#' + shownextpic).show();
var selected = '<img src="' + $('#' + lastvisible).attr('src') + '">';
var bild = selected.replace("/klein/", "/normal/");
$("#previewprofil").html(bild);
buttons();
}
function prev(){
var firstvisible = $(".thumbprofilpic:visible:first").attr("id");
var lastvisible = $(".thumbprofilpic:visible:last").attr("id");
var showprevpic = parseInt(firstvisible) - 1;
var hidenextpic = parseInt(lastvisible);
$('#' + showprevpic).show();
$('#' + hidenextpic).hide();
var selected = '<img src="' + $('#' + firstvisible).attr('src') + '">';
var bild = selected.replace("/klein/", "/normal/");
$("#previewprofil").html(bild);
buttons();
}
function picid(z){
var selected = '<img src="' + $(z).attr('src') + '">';
var bild = selected.replace("/klein/", "/normal/");
$("#previewprofil").html(bild);
}
它适用于chrome,safari,opera和firefox,但不适用于IE(ofc,我对这个POS感到厌烦)有人可以告诉我如何编辑这段代码以使其适应这种瘟疫吗?
答案 0 :(得分:0)
我通过将background-color: yellow; filter:alpha(opacity=60); opacity:.0;
添加到next
和prev
divs -.-