假设在MVC 3 应用程序中有以下代码:
在这种情况下,你如何使用jQuery来实现不显眼的JavaScript(event onfocus和onclick)?
if (Model.ImageListGallery != null)
{
<h3>@ImagesTranslation.Gallery</h3>
foreach (var imageInGallery in Model.ImageListGallery)
{
<div id="@imageInGallery.IdImage">
<a rel="group" href= "@Url.Action("displaybig", "news", new { idNews = Model.IdNews, idImage = imageInGallery.IdImage })">
<img src= "@Url.Action("displaysmall", "news", new { idNews = Model.IdNews, idImage = imageInGallery.IdImage })" alt=""/></a>
@Html.Label(ImagesTranslation.Description)
@Html.TextArea("Description", imageInGallery.Description, new { id = "area" + imageInGallery.IdImage, onfocus = "removeDisabledBtnOnImage('" + imageInGallery.IdImage + "')" })
<button disabled="disabled" id="btn@(imageInGallery.IdImage)" onclick="saveDescription('@imageInGallery.IdImage')">@CommonTranslations.Save</button>
<img class="@imageInGallery.IdImage" src="@Href("~/Content/delete.png")" onclick="deleteImage('@imageInGallery.IdImage')" title="@ImagesTranslation.DeleteImage" alt=""/>
</div>
}
}
在这种情况下,你如何使用jQuery来实现不显眼的JavaScript(event onfocus和onclick)?