0
我正在使用ASP.NET MVC3和jQuery Cycle Plugin构建图像库项目。这是我的代码有:获取当前照片的ID当前照片jQuery圈幻灯片库
$(document).ready(function() {
$('#s1').cycle({
fx: 'curtainX',
speed: 2000,
next: '#raty',
timeout: 0,
after: Rate
});
}):
我从页面源代码如下列表:
<div id="s1" class="slides">
<img src="/Photo/Thumbnail/14?size=large" title="walk 071" alt="14" />
<img src="/Photo/Thumbnail/15?size=large" title="walk 083" alt="15" />
<img src="/Photo/Thumbnail/16?size=large" title="walk 125" alt="16" />
<img src="/Photo/Thumbnail/17?size=large" title="001" alt="17" />
<img src="/Photo/Thumbnail/18?size=large" title="002" alt="18" />
<img src="/Photo/Thumbnail/19?size=large" title="003" alt="19" />
<img src="/Photo/Thumbnail/20?size=large" title="004" alt="20" />
<img src="/Photo/Thumbnail/21?size=large" title="005" alt="21" />
<img src="/Photo/Thumbnail/22?size=large" title="006" alt="22" />
</div>
问题: 我想通过当前照片的编号(INT)幻灯片从IMG网址上面的控制器动作,以便我可以在运行时异步显示来自数据库的相关信息。如何才能做到这一点?
这里是位指示操作:
public ActionResult AboutMe(int id)
{
var myphoto = dbase.Photos.Single(x => x.PhotoId == id);
var model = new MeViewModel
{
UserName =myphoto.UserProfile.UserName,
Location =myphoto.UserProfile.Location,
...Continue populating model
};
return PartialView(model);
}
还有别的东西:此网址“(
)”,我怎么能提取图片ID在这种情况下发生是否要异步传递给控制器动作? –
user1350968
'$(currentSlideElement).attr('alt')' – lucuma