asp.net中使用jquery实现动态加载新闻框
前台
样式代码:
<style type="text/css">
div.PhotoList
{
margin:0;
padding:0;
position:relative;
}
div.PhotoListPhotos
{
width:100%;
height:100%;
border:1px solid black;
}
div.PhotoListPhotos img
{
width:100%;
height:100%;
position:absolute;
top:0;
left:0;
border:1px solid black;
}
.PhotoListDivPager
{
margin-left:2px;
margin-right:2px;
position:absolute;
bottom:0;
width:99%;
z-index:2;
background-color:Silver;
}
.PhotoListDivPager small
{
float:left;
padding-left:3px;
color:White;
}
.PhotoListDivPager div
{
float:right;
}
.PhotoListDivPager div span
{
color:White;
padding-left:3px;
padding-right:3px;
}
.PhotoListDivPager div span:hover
{
color:Red;
}
</style>
js代码:
//注意需要引用jquery
<script type="text/jscript" src="jquery-2.1.0.min.js"></script>
<script type="text/javascript">
var newsArray;
$(document).ready(function () {
//注意获取新闻的页面路径
$.get("../AJAX/GetPhotos.aspx", function (data, status) {
//解析json数据
&