php - 悬停时拆分按钮

标签 php javascript html

我正在寻找一种解决方案,以便在悬停时将一个基于图形的按钮一分为二。这两个按钮都会有一个网站链接。 我需要使用 HTML、JS 或 PHP 执行此操作。

如何管理?

澄清更新

  1. 我的索引页上有一个大按钮图形,上面写着“Enter”。
  2. 通过点击按钮,“输入”按钮消失
  3. 两个新按钮出现在那个确切的位置。
  4. 第一个说“英语版”,另一个说“西类牙语版”
  5. 当鼠标离开该区域时,原来的按钮会重新显示,两个语言按钮会消失

最佳答案

您可以使用带有 jquery 和 jqueryui.Button 的 javascript 来做到这一点

来自 jqueryui 网站的示例:

http://jqueryui.com/demos/button/#splitbutton

<script>
    $(function() {
        $( "#rerun" )
            .button()
            .click(function() {
                alert( "Running the last action" );
            })
            .next()
                .button( {
                    text: false,
                    icons: {
                        primary: "ui-icon-triangle-1-s"
                    }
                })
                .click(function() {
                    alert( "Could display a menu to select an action" );
                })
                .parent()
                    .buttonset();
    });
</script>

<div class="demo">

<div>
    <button id="rerun">Run last action</button>
    <button id="select">Select an action</button>
</div>

</div><!-- End demo -->

关于php - 悬停时拆分按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6326018/

相关文章:

javascript - 如何使用Ajax通过此方法发送查询

javascript - 为什么不需要工作来验证我的表格?

javascript onclick代码更改

php - 从 HTML 表单发布到数据库时出现 UNDEFINED INDEX 错误

php - 根据使用 ng-option 从数据库(mysql)检索的数据在下拉列表中选择特定选项

php - 使用 Nova 资源成功上传图像,但在同一资源中收到 "This image could not be found"

php - 使用ajax和php在MYSQL中插入数据

jquery - 单击时不隐藏文本

html - 如何使用 Spring 和 Thymeleaf 显示没有 html 标签的消息

php - 从多个表中选择时,如何在分组之前实现排序