本文介绍了使表格行可点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
最常见的(也是唯一的)解决方案似乎是使用JavaScript,通过使用的onclick = JavaScript的:document.location.href( 'bla.htm'); (不要忘记:用onmouseover / onmouseout设置一个合适的光标)。
尽管这样做很可惜目标URL在状态栏中不可见一个浏览器,不像普通的链接。
所以我只是想知道是否有任何优化空间?是否可以在浏览器的状态栏中显示要导航到的URL?或者是否有一种非JavaScript的方式让tr变得可点击?解析方案
幸运的是,不幸的是,大多数现代浏览器都不允许你可以控制状态栏了(因为欺诈的意图,它可能会在当天流行)。
你最好的选择是一个title属性或一个。
I wonder what the best way to make an entire tr clickable would be?
The most common (and only?) solution seems to be using JavaScript, by using onclick="javascript:document.location.href('bla.htm');" (not to forget: Setting a proper cursor with onmouseover/onmouseout).
While that works, it is a pity that the target URL is not visible in the status bar of a browser, unlike normal links.
So I just wonder if there is any room for optimization? Is it possible to display the URL that will be navigated to in the status bar of the browser? Or is there even a non-JavaScript way to make a tr clickable?
解决方案
Fortunately or unfortunately, most modern browsers do not let you control the status bar anymore (it was possible and popular back in the day) because of fraudulent intentions.
Your better bet would be a title attribute or a javascript tooltip.
这篇关于使表格行可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!