当从文本框MVC中选择文本时,如何显示弹出窗口等通知 [英] How can I show notice like popup when select text from textbox MVC

查看:83
本文介绍了当从文本框MVC中选择文本时,如何显示弹出窗口等通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我选择文本时需要的文本框显示上面弹出文本的通知



我的文本框



@ Html.TextBox(ShortUrl,这是测试,新{@class =name_comment,@ readonly =readonly})



我尝试了什么:



我尝试了很多东西,但我需要任何提示,因为我不知道

I have textbox I need when I select the text shows notice like popup above text

my textbox

@Html.TextBox("ShortUrl", "this is the test", new { @class = "name_comment", @readonly = "readonly" })

What I have tried:

I tried alot of things but I need any hints because I have no idea

推荐答案

使用 css [ ^ ]



customize it based on your need using css[^]

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>

    <script>
        function showbaloon(elem) {
            elem.style.display = "block";
        }
        function hidebaloon(elem) {
            elem.style.display = "none";
        }


    </script>

    <style>
        .baloon {
            position: absolute;
            margin: 5px 5px 10px 10px;
            width: 130px;
            height: 15px;
            font-family: arial,sans-serif;
            background-color: black;
            color: white;
            font-size: 11px;
            display: none;
        }
    </style>
</head>
<body>

    <input type="text" onfocus="showbaloon(baloon1)" onblur="hidebaloon(baloon1)" id="LongUrlText2" value="some data" />
    <div class="baloon" id="baloon1">
        PRESS CTRL-C to copy
    </div>
</body>
</html>


这篇关于当从文本框MVC中选择文本时,如何显示弹出窗口等通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆