问题描述
小弟刚毕业.打算完善下毕业设计.查找到如下的东西.可惜不会用。对javascript、css一点不懂.http://blog.csdn.net/yanghua_kobe/article/details/6401683各位大哥能否告诉小弟应该怎么用呢.就是放到哪里.或者需要建立什么文件么?我现在有现成的aspx文件..应该怎么添加..谢谢.
解决方案
解决方案二:
额。。你那个链接里所有的代码都贴出来了还不会用啊。。JS就直接放在aspx里<scripttype="text/javascript"></script>这个之间。。。css放在<styletype="text/css"></style>之间
解决方案三:
<headrunat="server"><title>标题</title><linkhref="../../Styles/css.css"rel="Stylesheet"type="text/css"/><scriptsrc="/Scripts/jquery-1.4.1.js"type="text/javascript"></script></head>
放.aspx页面里
解决方案四:
AutoComplete整个数据库里面放你的后缀。或者<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><title></title><scriptsrc="http://www.cwydesign.com/effects/UploadFiles_7074/201105/2011050922474992.js"type="text/javascript"></script><styletype="text/css">body{margin:0px;padding:0px;font-family:Arial;font-size:12px;padding:10px;}#myemail,.newemail,.newemailtitle{cursor:default;line-height:18px;}</style></head><body>Email<inputid="me"type="text"value=""style="width:150px;height:18px;line-height:18px;border:1pxsolid#999;"><scripttype="text/javascript">varnowid;vartotalid;varcan1press=false;varemailafter;varemailbefor;$(document).ready(function(){$("#me").focus(function(){//文本框获得焦点,插入Email提示层$("#myemail").remove();$(this).after("<divid='myemail'style='width:170px;height:auto;background:#fff;color:#6B6B6B;position:absolute;left:"+$(this).get(0).offsetLeft+"px;top:"+($(this).get(0).offsetTop+$(this).height()+2)+"px;border:1pxsolid#ccc;z-index:5px;'></div>");if($("#myemail").html()){$("#myemail").css("display","block");$(".newemail").css("width",$("#myemail").width());can1press=true;}else{$("#myemail").css("display","none");can1press=false;}}).keyup(function(){//文本框输入文字时,显示Email提示层和常用Emailvarpress=$("#me").val();if(press!=""||press!=null){varemailtxt="";varemailvar=newArray("@163.com","@126.com","@yahoo.com","@qq.com","@sina.com","@gmail.com","@hotmail.com","@foxmail.com");totalid=emailvar.length;varemailmy="<divclass='newemail'style='width:170px;color:#6B6B6B;overflow:hidden;'><fontcolor='#D33022'>"+press+"</font></div>";if(!(isEmail(press))){for(vari=0;i<emailvar.length;i++){emailtxt=emailtxt+"<divclass='newemail'style='width:170px;color:#6B6B6B;overflow:hidden;'><fontcolor='#D33022'>"+press+"</font>"+emailvar[i]+"</div>"}}else{emailbefor=press.split("@")[0];emailafter="@"+press.split("@")[1];for(vari=0;i<emailvar.length;i++){vartheemail=emailvar[i];if(theemail.indexOf(emailafter)==0){emailtxt=emailtxt+"<divclass='newemail'style='width:170px;color:#6B6B6B;overflow:hidden;'><fontcolor='#D33022'>"+emailbefor+"</font>"+emailvar[i]+"</div>"}}}$("#myemail").html(emailmy+emailtxt);if($("#myemail").html()){$("#myemail").css("display","block");$(".newemail").css("width",$("#myemail").width());can1press=true;}else{$("#myemail").css("display","none");can1press=false;}beforepress=press;}if(press==""||press==null){$("#myemail").html("");$("#myemail").css("display","none");}})$(document).click(function(){//文本框失焦时删除层if(can1press){$("#myemail").remove();can1press=false;if($("#me").focus()){can1press=false;}}})$(".newemail").live("mouseover",function(){//鼠标经过提示Email时,高亮该条Email$(".newemail").css("background","#FFF");$(this).css("background","#CACACA");$(this).focus();nowid=$(this).index();}).live("click",function(){//鼠标点击Email时,文本框内容替换成该条Email,并删除提示层varnewhtml=$(this).html();newhtml=newhtml.replace(/<.*?>/g,"");$("#me").val(newhtml);$("#myemail").remove();})$(document).bind("keydown",function(e){if(can1press){switch(e.which){case38:if(nowid>0){$(".newemail").css("background","#FFF");$(".newemail").eq(nowid).prev().css("background","#CACACA").focus();nowid=nowid-1;}if(!nowid){nowid=0;$(".newemail").css("background","#FFF");$(".newemail").eq(nowid).css("background","#CACACA");$(".newemail").eq(nowid).focus();}break;case40:if(nowid<totalid){$(".newemail").css("background","#FFF");$(".newemail").eq(nowid).next().css("background","#CACACA").focus();nowid=nowid+1;}if(!nowid){nowid=0;$(".newemail").css("background","#FFF");$(".newemail").eq(nowid).css("background","#CACACA");$(".newemail").eq(nowid).focus();}break;case13:varnewhtml=$(".newemail").eq(nowid).html();newhtml=newhtml.replace(/<.*?>/g,"");$("#me").val(newhtml);$("#myemail").remove();}}})})//检查email邮箱functionisEmail(str){if(str.indexOf("@")>0){returntrue;}else{returnfalse;}}</script></body></html>
复制代码保存后缀为.HTML打开输入
解决方案五:
引用3楼wxr0323的回复:
AutoComplete整个数据库里面放你的后缀。或者HTMLcode<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/……
AutoComplete这个ajax控件还需要设置一些其他属性么?我设置了些只有输入@时候才出现提示..输入xxx@、444@、这类的不会提示呢?谢谢楼上三位大哥,很有用.谢谢..