在我的 ASP.NET MVC 网站的页脚中,我返回了一个部分 View ,其中包含我最新作品的“照片提要”。该 View 使用样式 <ul>
和 <li>
标签来组织图像。样式取自 ReStart Bootstrap theme .下面是 View 的演示内容:
这是生成上述内容的部分 View 中包含的标记:
<div class="footer_teaser col-sm-4 col-md-4" id="latest-flickr-images">
<h3 style="color:#ffffff">Recent photography</h3>
<ul>
</ul>
<p>All photos © by <a href="https://www.snobbyphotographer.net" style="color:#ffffff"><strong>Kanapolis</strong></a>.</p>
注意到什么有趣的事了吗?正确,我已经删除了 <li>
来自标记的标签和内容链接,但演示内容仍在调试中。删除 <ul>
标签摆脱了他们。在 Restart 的根目录中 style.css
文件和预编译的 style.less
,我可以看到选择器名为 #latest-flickr-images ul
.但是,我在我的元素目录中找不到任何针对此特定 <ul>
的脚本文件。元素。我不太熟悉 CSS 或像 LESS 这样的预处理器以及它们如何与 jQuery 交互。我在这里缺少什么?
最佳答案
通过在主题的主脚本模板文件中找到指向 <ul>
的 jQuery 脚本,移除了不需要的行为。并将其注释掉:
////Flickr feed snippet by css-tricks.com
// jQuery.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id=37321137@N03&format=json&jsoncallback=?", function(data) {
// var target = "#latest-flickr-images ul"; // Where is it going?
// for (i = 0; i <= 9; i = i + 1) { // Loop through the 10 most recent, [0-9]
// var pic = data.items[i];
// var liNumber = i + 1; // Add class to each LI (1-12)
// jQuery(target).append("<li class='flickr-image no-" + liNumber + "'><a rel='prettyPhoto' title='" + pic.title + "' href='" + pic.link + "'><img src='" + pic.media.m + "' /></a></li>");
// }
// });
关于css - ASP.NET MVC View 中的 Ghost 自定义 Bootstrap HTML 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32878697/