我正在使用 jQuery 库,默认情况下第一次使用 js 加载图像;单击按钮时,我清空列表并再次加载图像,但即使我使用该功能,图像也不会显示.reload()
。在 .reload() 页面再次加载并再次显示默认图像,但我希望在使列表为空后单击按钮上加载的图像。我还使用了仅刷新页面某些部分的方法。IE
这里“list” id my,我首先将其清空,“1”是我要重新加载的 div,其中包含 id =“slider”的画廊,下面是我的全部功能:
("#list").empty();
$("#1").reload(location.href+" #slider>*");
var button=i;
if(button==1){
alert('1')
$('ul').append('<li> <img src="images/round.jpg" style="height:400px;width:900px;" /> <center> <strong>Capacity :</strong>500 <br> <strong>Rent : </strong>5000 Rs.<br> <strong>Arrangment : </strong>Circular Table Arrangement.<br></center></li>');
}
if(button==2){
$('ul').append('<li> <img src="images/round.jpg" style="height:400px;width:900px;" /> <center> <strong>Capacity :</strong>500 <br> <strong>Rent : </strong>5000 Rs.<br> <strong>Arrangment : </strong>Circular Table Arrangement.<br></center></li>');
$('ul').append('<li> <img src="images/square.jpg" style="height:400px;width:900px;" /> <center> <strong>Capacity : </strong>10,000<br><strong>Rent : </strong>35,000 Rs.<br><strong>Arrangment : </strong>Square Table Arrangement. <br></center> </li>');
}
if(button==3){
$('ul').append('<li> <img src="images/round.jpg" style="height:400px;width:900px;" /> <center> <strong>Capacity :</strong>500 <br> <strong>Rent : </strong>5000 Rs.<br> <strong>Arrangment : </strong>Circular Table Arrangement.<br></center></li>');
$('ul').append('<li> <img src="images/square.jpg" style="height:400px;width:900px;" /> <center> <strong>Capacity : </strong>10,000 <br> <strong>Rent : </strong>35,000 Rs.<br><strong>Arrangment : </strong>Square Table Arrangement. <br></center> </li>');
$('ul').append('<li> <img src="images/square.jpg" style="height:400px;width:900px;" /> </li>');
}
if(button==4){
$('ul').append('<li> <img src="images/round.jpg" style="height:400px;width:900px;" /> <center> <strong>Capacity :</strong>500 <br> <strong>Rent : </strong>5000 Rs.<br> <strong>Arrangment : </strong>Circular Table Arrangement.<br></center></li>');
$('ul').append('<li> <img src="images/square.jpg" style="height:400px;width:900px;" /> <center> <strong>Capacity : </strong>10,000 <br> <strong>Rent : </strong>35,000 Rs.<br><strong>Arrangment : </strong>Square Table Arrangement. <br></center> </li>');
$('ul').append('<li> <img src="images/line.jpg" style="height:400px;width:900px;" /> </li>');
$('ul').append('<li> <img src="images/square.jpg" style="height:400px;width:900px;" /> <center> <strong>Capacity : </strong>10,000 <br> <strong>Rent : </strong>35,000 Rs.<br><strong>Arrangment : </strong>Square Table Arrangement. <br></center> </li>');
}
}