增加了滚动信息的jquery代码

This commit is contained in:
Li Jianxuan 2011-11-08 10:09:09 +00:00
parent a44effeba9
commit bf5750a2dd
1 changed files with 59 additions and 33 deletions

View File

@ -5,6 +5,7 @@ $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/water.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->headScript()->appendFile('/js/jquery-1.6.4.min.js');
$this->breadcrumb($this->config->title->heihe);
$this->breadcrumb()->setSeparator(' > ');
?>
@ -25,10 +26,35 @@ $this->breadcrumb()->setSeparator(' > ');
</div>
<div id="heihe_ad">
<h2>已整理数据展示</h2>
<ul id="heihe_list">
<li><img src="/images/water/arid.jpg" /></li>
<li><img src="/images/water/arid.jpg" /></li>
<li><img src="/images/water/arid.jpg" /></li>
</ul>
<a href="javascript:;" onclick="changetlist()">换一组</a>
<?php foreach($this->meatdata as $md) : ?>
<a href="/heihe/view/uuid/<?php echo $md['uuid']; ?>"><span><?php echo $md['title']; ?></span>
<img src="/service/thumb/id/<?php echo $md['id']; ?>" alt="Data Thumbnail" title="<?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>" />
</a>
<?php endforeach; ?>
</div>
</div>
<script type="text/javascript" language="javascript">
function changetlist(){
$.getJSON("/heihe/changelist", function(data){
$('#heihe_list').html('');
if(data.length>0)
{
$.each(data, function(key, val) {
var a = '<a href="/heihe/view/uuid/'+val['uuid']+'"><span>'+val['title']+'</span>';
var img = '<img src="'+val['src']+'" alt="Data Thumbnail" />';
$('<li/>', {
//"class":'list_img',
"html": a+img+'</a>'
}).appendTo('#heihe_list');
});
}
});
}
</script>