如何将图标与记录链接但将其显示在远离记录部分的地方?
您好,我对编程非常陌生,无法找到实现此目的的方法,
我目前有一个场地记录表,每个记录都在索引页面上显示为部分内容。我希望每个场地都有一个图标,显示在屏幕一侧的地图上。地图只是一个带有背景图像的 div。
如何让每个场馆都有自己的图标,通过绝对定位的方式放置在地图上?但仅在显示关联场地时显示,因为可以过滤场地结果。
非常感谢您的帮助!
Hello I'm super new to programming and cant figure a way of accomplishing this,
I currently have a table of venue records and each is being displayed as a partial on the index page. I would like for each venue to have an icon which displays on a map I have on one side of the screen. The map is just a div with a background image.
How can each venue have its own icon which is placed on the map by absolute positioning? but only displays when its associated venue is display as the venue results can be filtered.
Thanks very much for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看看:http://guides.rubyonrails.org/layouts_and_rendering.html#understand-yield< /a> 和 content_for。这些将允许您使用部分数据填充页面的单独部分。
Look at : http://guides.rubyonrails.org/layouts_and_rendering.html#understanding-yield and content_for. These will allow you to populate a separate part of the page with data from partials.
我在场地部分 html.erb 文件中使用 jQuery 来管理此操作:
我将 iconleftpx:integer 和 icontoppx:integer 字段添加到场地表中,这些字段填充 jQuery 代码调用的绝对定位的顶部和左侧值。
I managed this with this bit of jQuery in the venue partial html.erb file:
I added iconleftpx:integer and icontoppx:integer fields to the venue table which populate the top and left values for the absolute positioning called by the jQuery code.