久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='zMWxt'></bdo><ul id='zMWxt'></ul>

      <legend id='zMWxt'><style id='zMWxt'><dir id='zMWxt'><q id='zMWxt'></q></dir></style></legend>

      <tfoot id='zMWxt'></tfoot>
    1. <i id='zMWxt'><tr id='zMWxt'><dt id='zMWxt'><q id='zMWxt'><span id='zMWxt'><b id='zMWxt'><form id='zMWxt'><ins id='zMWxt'></ins><ul id='zMWxt'></ul><sub id='zMWxt'></sub></form><legend id='zMWxt'></legend><bdo id='zMWxt'><pre id='zMWxt'><center id='zMWxt'></center></pre></bdo></b><th id='zMWxt'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zMWxt'><tfoot id='zMWxt'></tfoot><dl id='zMWxt'><fieldset id='zMWxt'></fieldset></dl></div>

      <small id='zMWxt'></small><noframes id='zMWxt'>

    2. 使用jQuery淡出文本字段內的文本值

      Fade out text value inside of text field using jQuery(使用jQuery淡出文本字段內的文本值)

          <legend id='2m0gd'><style id='2m0gd'><dir id='2m0gd'><q id='2m0gd'></q></dir></style></legend><tfoot id='2m0gd'></tfoot>
        • <i id='2m0gd'><tr id='2m0gd'><dt id='2m0gd'><q id='2m0gd'><span id='2m0gd'><b id='2m0gd'><form id='2m0gd'><ins id='2m0gd'></ins><ul id='2m0gd'></ul><sub id='2m0gd'></sub></form><legend id='2m0gd'></legend><bdo id='2m0gd'><pre id='2m0gd'><center id='2m0gd'></center></pre></bdo></b><th id='2m0gd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2m0gd'><tfoot id='2m0gd'></tfoot><dl id='2m0gd'><fieldset id='2m0gd'></fieldset></dl></div>

              <tbody id='2m0gd'></tbody>

                <bdo id='2m0gd'></bdo><ul id='2m0gd'></ul>
              • <small id='2m0gd'></small><noframes id='2m0gd'>

                本文介紹了使用jQuery淡出文本字段內的文本值的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我不完全確定這是否可能,總的來說,我對 jQuery 和 JavaScript 非常了解,但是這個讓我很難過.我創(chuàng)建了一個簡單的插件,它清除焦點上的文本輸入,然后在沒有輸入任何內容時顯示默認值.

                I am not entirely sure if this is possible or not, I am pretty knowledgeable when it comes to jQuery and JavaScript in general, but this one has me stumped. I've created a simple plugin that clears a text input on focus and then displays the default value if nothing has been entered.

                是否可以僅淡出文本輸入中的文本本身,而不是整個字段本身?所有嘗試似乎都導致文本字段本身淡出并最終隱藏元素.

                Is it possible to fade out just the text itself inside of the text input, and not the whole field itself? All attempts seem to result in the text field itself fading out and eventually hiding the element from view.

                我確實想出了一個解決方案,使用包含默認值的跨度并將它們絕對定位在文本輸入上,根據用戶是否輸入任何文本來隱藏和顯示它們.如果存在的話,我寧愿采用一種更直接的方法.

                I did come up with a solution of using spans containing the default value and absolutely positioning them over the text input, hiding and showing them depending if a user has entered any text or not. I would much rather a much straightforward approach if one exists.

                編輯

                使用 jQuery UI 中或作為 jQuery 插件提供的 jQuery animate 函數,您可以將文本顏色設置為在字段聚焦和模糊時輸入的顏色(如下所述).這是我正在使用的代碼,以防您想知道如何操作.

                Using the jQuery animate function which is in jQuery UI or available as a plugin for jQuery, you can animate the text color to be the color of the input upon focusing and blurring of the field (as pointed out below). Here is the code that I am using in-case you wanted to know how.

                    obj.bind("focus", function() {
                  if ($(this).val() == oldValue) {
                      $(this).animate({ color: '#E8DFCC' }, 1000).val('');
                  }
                 });
                
                 obj.bind("blur", function() {
                  if ($(this).val().length <= 3) {
                      $(this).animate({ color: '#56361E' }, 600).val(oldValue);
                  }
                 });
                

                推薦答案

                想一想,你有沒有試過用動畫的方法改變文本框中的文字顏色以匹配背景?然后動畫完成后就可以清空內容了.

                Just a quick thought, have you tried using the animation method to change the color of the text in the text box to match the background? Then when the animation completes you can clear the contents.

                這是一個想法.我已經有一段時間沒有使用動畫了,但如果你有興趣,我可能會制作一個代碼示例.

                Its a thought. Its been a while since I've used the animation stuff, but I could probably whip up a code sample if you are interested.

                這篇關于使用jQuery淡出文本字段內的文本值的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發(fā)技術分
                Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)

                  1. <legend id='vOYtf'><style id='vOYtf'><dir id='vOYtf'><q id='vOYtf'></q></dir></style></legend>
                      <bdo id='vOYtf'></bdo><ul id='vOYtf'></ul>

                        <tfoot id='vOYtf'></tfoot>

                        <small id='vOYtf'></small><noframes id='vOYtf'>

                          <tbody id='vOYtf'></tbody>
                      • <i id='vOYtf'><tr id='vOYtf'><dt id='vOYtf'><q id='vOYtf'><span id='vOYtf'><b id='vOYtf'><form id='vOYtf'><ins id='vOYtf'></ins><ul id='vOYtf'></ul><sub id='vOYtf'></sub></form><legend id='vOYtf'></legend><bdo id='vOYtf'><pre id='vOYtf'><center id='vOYtf'></center></pre></bdo></b><th id='vOYtf'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vOYtf'><tfoot id='vOYtf'></tfoot><dl id='vOYtf'><fieldset id='vOYtf'></fieldset></dl></div>

                        1. 主站蜘蛛池模板: 欧美日韩精品在线一区 | 古典武侠第一页久久777 | 综合中文字幕 | 国产一区精品 | 日韩欧美在线观看 | 中文字幕乱码视频32 | 一区二区精品 | 综合久久综合久久 | 正在播放国产精品 | 久久婷婷麻豆国产91天堂 | 国产精品久久久久久一区二区三区 | 中文字幕欧美日韩一区 | 日本精品在线观看 | 国产一区二区三区免费观看视频 | 国产日韩精品在线 | 狠狠插天天干 | 日韩在线免费视频 | www.久 | 亚洲综合网站 | 国产日韩欧美在线播放 | 国产精品123区 | 2021狠狠干 | 黄色毛片网站在线观看 | 91日b| 欧美日韩精品一区二区三区四区 | 能免费看的av | 中国一级特黄真人毛片免费观看 | 亚洲美女一区二区三区 | 人人干免费 | 精品久久国产 | 日韩a | 国产一区视频在线 | 在线国产小视频 | 黄色大片在线播放 | 成人午夜网站 | 欧美第一区 | 北条麻妃av一区二区三区 | 久久精品久久久久久 | 中文字幕在线观看一区二区 | 剑来高清在线观看 | 成年视频在线观看福利资源 |