使用prototype改变iweb生成的导航菜单
我有一个由 iWeb 中的客户端生成的“网站”。他想继续使用 iwebs 并简单地上传生成的网站,但我注意到菜单的 CSS 中存在一些不一致,而且他还需要菜单中的一个元素来链接到外部 URL。这两个问题似乎都无法在 iWeb 应用程序/编辑器中修复。
据我所知,iWeb 使用原型绘制菜单 - 所以它不是静态 HTML。不过,我应该能够使用 protoype 导航生成的 HTML(这是 iweb 使用的,所以我也应该能够使用它,对吗?)来编辑
通过这种方式“修复”他的位置,我只需在他上传后包含一个脚本文件即可?
既然如此
如何设置每个 LI 项目的填充并更改“产品”LI 的内容以链接到其他位置。
尝试了几件事,但似乎都没有任何作用。
$("ul#widget0-navbar-list li").each(function(elm){
elm.setStyle({"背景颜色": "#FFFFFF"});
});
I have a 'website' that been generated by a client in iWeb. He wants to keep using iwebs and simply upload the generated site however I have noticed some inconsistencies in the CSS of the menu and also he need an element in the menu to link to an external URL. Both of which seem not to be fixable in the iWeb Application / editor.
From what I can tell iWeb draws the menu using prototype - so it is not static HTML. However I should be able to navigate the produced HTML with protoype (which is what iweb uses so I should be able to use it also right?) to edit the style of the
this way to 'fix' his sit I just have to include one script file after he uploads it?
So given
<ul class="navbar-list" id="widget0-navbar-list">
<li class="current-page"><a>Welcome </a></li>
<li class="noncurrent-page"><a>Why? </a></li>
<li class="noncurrent-page"><a>Uses </a></li>
<li class="noncurrent-page"><a>Products </a></li>
</ul>
how can I set the padding of each LI item and chaneg the content of the 'Product' LI to link somewhere else.
Have tried several thing but all seem to do nothing.
$("ul#widget0-navbar-list li").each(function(elm){
elm.setStyle({"background-color": "#FFFFFF"});
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 Javascript,带有破折号的 CSS 属性必须以驼峰式命名。因此,对于背景,尝试使用“backgroundColor”而不是“background-color”,它应该可以工作并且不要使用引号:
With Javascript the CSS properties with a dash has to be written in camel-case. So for the background try to use "backgroundColor" instead of "background-color" and it should work and do not use quotation marks: