بالنسبة لو لديك textarea عدل الكود في الجزئيتين
كود:$("textarea,input").focus(function () { $(this).next("span").addClass('tooltips'); }); $("textarea,input").blur(function () { $(this).next("span").removeClass('tooltips') });
بالنسبة لو لديك textarea عدل الكود في الجزئيتين
كود:$("textarea,input").focus(function () { $(this).next("span").addClass('tooltips'); }); $("textarea,input").blur(function () { $(this).next("span").removeClass('tooltips') });
شكرا لك أخي soma.
لكي لا أعمم نوافذ الـ hint على جميع وسوم span الموجودة في ملف الـ HTML
قمت باضافة السطر التالي في ملف الـ CSS :
مع تسمية النموذج :كود:form1 span#
ولكن الـ hint لم يعمل معي !!؟كود:<form id="form1" name="form">
فجربت التالي :
وفي ملف الـ html اضفت الى الـ spanكود:span .hint
وغيرت في سطر الـAJAX ليصبح كالتلي :كود:<span class="hint">
ولكن الأمر كذلك لم يشتغل معي !!!؟كود:<script language="JavaScript" type="text/javascript"> $(document).ready(function(){ $("input, textarea, select").focus(function () { $(this).next("span .hint").addClass('notice'); }); $("input, textarea, select").blur(function () { $(this).next("span .hint").removeClass('notice') }); }); </script>
ما الأمر يا ترى ؟
شكراَ.
ممكن تضع كودك كاملاً ....
ها هو :
كود:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script language="JavaScript" type="text/javascript" src="js/jquery-1.3.min.js"></script> <script> $(document).ready(function(){ $("input, textarea, select").focus(function () { $(this).next("span .hint").addClass('tooltips'); }); $("input, textarea, select").blur(function () { $(this).next("span .hint").removeClass('tooltips') }); }); </script> <style> span.hint { padding:5px 5px 5px 40px; width:120px; position:absolute; margin: 2px 0 0 14px; display:none; } .tooltips{ display:inline; background-color:gray; } </style> </head> <body> <p>User Name<br> <input type="text" /> <span class="hint">Enter User Name</span></p> <p>Password<br> <input type="password" /> <span class="hint">Enter Password</span></p> </body> </html>![]()
كود:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script language="JavaScript" type="text/javascript" src="jquery.js"></script> <script> $(document).ready(function(){ $("input, textarea,select").focus(function () { $(this).next("span .hint").addClass('tooltips'); }); $("input, textarea,select").blur(function () { $(this).next("span .hint").removeClass('tooltips') }); }); </script> <style> .hint { padding:5px 5px 5px 40px; width:120px; position:absolute; margin: 2px 0 0 14px; display:none; } .tooltips{ display:inline; background-color:gray; } </style> </head> <body> <p>User Name<br> <input type="text" /> <span class="hint">Enter User Name</span></p> <p>Password<br> <input type="password" /> <span class="hint">Enter Password</span></p> </body> </html>
أخي soma،
أين الفرف بين الكودين ؟