css右键菜单样式,css左侧菜单栏
如何自定义网页的右键菜单?
在body中插入
成都创新互联公司执着的坚持网站建设,微信小程序定制开发;我们不会转行,已经持续稳定运营10年。专业的技术,丰富的成功经验和创作思维,提供一站式互联网解决方案,以客户的口碑塑造品牌,携手广大客户,共同发展进步。
STYLE type=text/cssBODY {
FONT-SIZE: 12px;
}
.info{FONT-SIZE: 14px;color:#FFFFFF;font-family:@Tahoma,@宋体;width:20px}
TABLE {
CURSOR: default; FONT-SIZE: 12px; MARGIN: 0px
}
TR {
HEIGHT: 20px
}
TR.over {
BACKGROUND-COLOR: #000080; COLOR: #ffffff; CURSOR: default; FONT-SIZE: 12px
}
TR.out {
BACKGROUND-COLOR: #efefef; COLOR: #000000; FONT-SIZE: 12px
}
DIV.rm_div {
BACKGROUND-COLOR: #efefef; BORDER-BOTTOM: #ffffff 1px outset; BORDER-LEFT: #ffffff 1px outset; BORDER-RIGHT: #ffffff 1px outset; BORDER-TOP: #ffffff 1px outset; DISPLAY: none; FILTER: Alpha(Opacity='95'); HEIGHT: 0px; PADDING-BOTTOM: 1px; PADDING-LEFT: 1px; PADDING-RIGHT: 1px; PADDING-TOP: 1px; POSITION: absolute; WIDTH: 0px
}
HR.sperator {
BORDER-BOTTOM: #ffffff 1px inset; BORDER-LEFT: #ffffff 1px inset; BORDER-RIGHT: #ffffff 1px inset; BORDER-TOP: #ffffff 1px inset; WIDTH: 95%
}
.w2kfont {
FONT-FAMILY: Tahoma; FONT-SIZE: 8pt
}
/STYLE
SCRIPT language=JScript
!--
function RightMenu()
{
this.AddExtendMenu=AddExtendMenu;
this.AddItem=AddItem;
this.GetMenu=GetMenu;
this.HideAll=HideAll;
this.I_OnMouseOver=I_OnMouseOver;
this.I_OnMouseOut=I_OnMouseOut;
this.I_OnMouseUp=I_OnMouseUp;
this.P_OnMouseOver=P_OnMouseOver;
this.P_OnMouseOut=P_OnMouseOut;
A_rbpm = new Array();
HTMLstr = "";
HTMLstr += "!-- RightButton PopMenu --\n";
HTMLstr += "\n";
HTMLstr += "!-- PopMenu Starts --\n";
HTMLstr += "div id='E_rbpm' class='rm_div'\n";
// rbpm = right button pop menu
HTMLstr += "table width='100%' border='0' cellspacing='0'\n";
HTMLstr += "trtd height='264' width='20' valign='bottom' bgcolor='#000000' onclick=window.event.cancelBubble=true; class=info作制娃海br:br窗视忧无\n";
HTMLstr += "/tdtd height='264' width='120' style='padding: 1' valign='bottom'\n";
HTMLstr += "table width='100%' border='0' cellspacing='0'\n";
HTMLstr += "!-- Insert A Extend Menu or Item On Here For E_rbpm --\n";
HTMLstr += "/table/td/tr/table\n";
HTMLstr += "/div\n";
HTMLstr += "!-- Insert A Extend_Menu Area on Here For E_rbpm --";
HTMLstr += "\n";
HTMLstr += "!-- PopMenu Ends --\n";
}
function AddExtendMenu(id,img,wh,name,parent)
{
var TempStr = "";
eval("A_"+parent+".length++");
eval("A_"+parent+"[A_"+parent+".length-1] = id"); // 将此项注册到父菜单项的ID数组中去
TempStr += "div id='E_"+id+"' class='rm_div'\n";
TempStr += "table width='100%' border='0' cellspacing='0'\n";
TempStr += "!-- Insert A Extend Menu or Item On Here For E_"+id+" --";
TempStr += "/table\n";
TempStr += "/div\n";
TempStr += "!-- Insert A Extend_Menu Area on Here For E_"+id+" --";
TempStr += "!-- Insert A Extend_Menu Area on Here For E_"+parent+" --";
HTMLstr = HTMLstr.replace("!-- Insert A Extend_Menu Area on Here For E_"+parent+" --",TempStr);
eval("A_"+id+" = new Array()");
TempStr = "";
TempStr += "!-- Extend Item : P_"+id+" --\n";
TempStr += "tr id='P_"+id+"' class='out'";
TempStr += " onmouseover='P_OnMouseOver(\""+id+"\",\""+parent+"\")'";
TempStr += " onmouseout='P_OnMouseOut(\""+id+"\",\""+parent+"\")'";
TempStr += " onmouseup=window.event.cancelBubble=true;";
TempStr += " onclick=window.event.cancelBubble=true;";
TempStr += "td nowrap";
TempStr += "font face='Wingdings' style='font-size:18px'0/font "+name+" /tdtd style='font-family: webdings; text-align: ;'4";
TempStr += "/td/tr\n";
TempStr += "!-- Insert A Extend Menu or Item On Here For E_"+parent+" --";
HTMLstr = HTMLstr.replace("!-- Insert A Extend Menu or Item On Here For E_"+parent+" --",TempStr);
}
function AddItem(id,img,wh,name,parent,location)
{
var TempStr = "";
var ItemStr = "!-- ITEM : I_"+id+" --";
if(id == "sperator")
{
TempStr += ItemStr+"\n";
TempStr += "tr class='out' onclick='window.event.cancelBubble=true;' onmouseup='window.event.cancelBubble=true;'td colspan='2' height='1'hr class='sperator'/td/tr";
TempStr += "!-- Insert A Extend Menu or Item On Here For E_"+parent+" --";
HTMLstr = HTMLstr.replace("!-- Insert A Extend Menu or Item On Here For E_"+parent+" --",TempStr);
return;
}
if(HTMLstr.indexOf(ItemStr) != -1)
{
alert("I_"+id+"already exist!");
return;
}
TempStr += ItemStr+"\n";
TempStr += "tr id='I_"+id+"' class='out'";
TempStr += " onmouseover='I_OnMouseOver(\""+id+"\",\""+parent+"\")'";
TempStr += " onmouseout='I_OnMouseOut(\""+id+"\")'";
TempStr += " onclick='window.event.cancelBubble=true;'";
if(location == null)
TempStr += " onmouseup='I_OnMouseUp(\""+id+"\",\""+parent+"\",null)'";
else
TempStr += " onmouseup='I_OnMouseUp(\""+id+"\",\""+parent+"\",\""+location+"\")'";
TempStr += "td nowrap";
TempStr +="font face='Wingdings' style='font-size:18px'"+wh+"/font "+ name+" ";
TempStr += "/tdtd/td/tr\n";
TempStr += "!-- Insert A Extend Menu or Item On Here For E_"+parent+" --";
HTMLstr = HTMLstr.replace("!-- Insert A Extend Menu or Item On Here For E_"+parent+" --",TempStr);
}
function GetMenu()
{
return HTMLstr;
}
function I_OnMouseOver(id,parent)
{
var Item;
if(parent != "rbpm")
{
var ParentItem;
ParentItem = eval("P_"+parent);
ParentItem.className="over";
}
Item = eval("I_"+id);
Item.className="over";
HideAll(parent,1);
}
function I_OnMouseOut(id)
{
var Item;
Item = eval("I_"+id);
Item.className="out";
}
function I_OnMouseUp(id,parent,location)
{
var ParentMenu;
window.event.cancelBubble=true;
OnClick();
ParentMenu = eval("E_"+parent);
ParentMenu.display="none";
if(location == null)
eval("Do_"+id+"()");
else
window.open(location);
}
function P_OnMouseOver(id,parent)
{
var Item;
var Extend;
var Parent;
if(parent != "rbpm")
{
var ParentItem;
ParentItem = eval("P_"+parent);
ParentItem.className="over";
}
HideAll(parent,1);
Item = eval("P_"+id);
Extend = eval("E_"+id);
Parent = eval("E_"+parent);
Item.className="over";
Extend.style.display="block";
Extend.style.posLeft=document.body.scrollLeft+Parent.offsetLeft+Parent.offsetWidth-4;
if(Extend.style.posLeft+Extend.offsetWidth document.body.scrollLeft+document.body.clientWidth)
Extend.style.posLeft=Extend.style.posLeft-Parent.offsetWidth-Extend.offsetWidth+8;
if(Extend.style.posLeft 0) Extend.style.posLeft=document.body.scrollLeft+Parent.offsetLeft+Parent.offsetWidth;
Extend.style.posTop=Parent.offsetTop+Item.offsetTop+1;
if(Extend.style.posTop+Extend.offsetHeight document.body.scrollTop+document.body.clientHeight)
Extend.style.posTop=document.body.scrollTop+document.body.clientHeight-Extend.offsetHeight;
if(Extend.style.posTop 0) Extend.style.posTop=0;
}
function P_OnMouseOut(id,parent)
{
}
function HideAll(id,flag)
{
var Area;
var Temp;
var i;
if(!flag)
{
Temp = eval("E_"+id);
Temp.style.display="none";
}
Area = eval("A_"+id);
if(Area.length)
{
for(i=0; i Area.length; i++)
{
HideAll(Area[i],0);
Temp = eval("E_"+Area[i]);
Temp.style.display="none";
Temp = eval("P_"+Area[i]);
Temp.className="out";
}
}
}
document.onmouseup=OnMouseUp;
document.onclick=OnClick;
function OnMouseUp()
{
if(window.event.button == 2)
{
var PopMenu;
PopMenu = eval("E_rbpm");
HideAll("rbpm",0);
PopMenu.style.display="block";
PopMenu.style.posLeft=document.body.scrollLeft+window.event.clientX;
PopMenu.style.posTop=document.body.scrollTop+window.event.clientY;
if(PopMenu.style.posLeft+PopMenu.offsetWidth document.body.scrollLeft+document.body.clientWidth)
PopMenu.style.posLeft=document.body.scrollLeft+document.body.clientWidth-PopMenu.offsetWidth;
if(PopMenu.style.posLeft 0) PopMenu.style.posLeft=0;
if(PopMenu.style.posTop+PopMenu.offsetHeight document.body.scrollTop+document.body.clientHeight)
PopMenu.style.posTop=document.body.scrollTop+document.body.clientHeight-PopMenu.offsetHeight;
if(PopMenu.style.posTop 0) PopMenu.style.posTop=0;
}
}
function OnClick()
{
HideAll("rbpm",0);
}
// Add Your Function on following
function Do_viewcode(){window.location="view-source:"+window.location.href;}
function Do_help(){window.showHelp(window.location);}
function Do_exit() {window.close();}
function Do_refresh() {window.location.reload();}
function Do_back() {history.back();}
function Do_forward() {history.forward();}
function Do_help(){
var s_help='stylebody,td{font:menu;padding:2}/style';
s_help+='title帮助/title';
s_help+='body bgcolor=menu';
s_help+='br 欢迎光临无忧视窗!本系统和您的Windows系统操作很相似。单击开始,打开开始菜单,双击桌面图标打开相关文件!span style="color:blue;cursor:hand" onclick=showHelp("windows.chm::/MS-ITS:ntdef.chm::/default.htm")本机帮助../span';
showModalDialog("about:"+s_help+"","","dialogHeight:110px;dialogWidth:210px;help:yes;status:no")}
--
/SCRIPT
META content="MSHTML 5.00.2920.0" name=GENERATOR/HEAD
BODY bgColor=#336699 oncontextmenu=window.event.returnValue=false
DIV id=snwcwt 请点击右键/DIV
SCRIPT language=JScript
!--
var menu = new RightMenu();
menu.AddItem("update","start_update","4","font class=w2kfontWeb Update/font","rbpm","http://");
menu.AddItem("suan","suan","a","大蒜之乡","rbpm","http://");
menu.AddItem("sperator","","","","rbpm",null);
menu.AddExtendMenu("program","start_pro","24","程序font class=w2kfont(uP/u)/font","rbpm",null);
menu.AddExtendMenu("p_acc","folder","+","附件","program",null);
menu.AddItem("p_acc1","html","+","font class=w2kfontMicrosoft FrontPage 2000/font","program","51w/game/");
menu.AddItem("p_acc2","html","+","font class=w2kfontNorton AntiVirus Corporate Edition/font","program","http://");
menu.AddExtendMenu("p_lgame","folder","16","小游戏","p_acc",null);
menu.AddItem("p_game1","folder","+","扫雷","p_lgame","51w/game/");
menu.AddItem("p_game2","folder","+","超级玛力","p_lgame","51w/game/");
menu.AddItem("p_game3","folder","+","五子棋","p_lgame","51w/game/");
menu.AddItem("p_game4","folder","+","俄罗斯方块","p_lgame","51w/game/");
menu.AddExtendMenu("doc","start_doc","24","文档font class=w2kfont(uD/u)/font","rbpm",null);
menu.AddItem("d_photo","folder","+","我的邮票","doc",null);
menu.AddExtendMenu("fav","start_fav","24","收藏font class=w2kfont(uA/u)/font","rbpm",null);
menu.AddExtendMenu("f_bbs","folder","16","论坛","fav",null);
menu.AddItem("f_bbs1","html","+","蓝色理想","f_bbs","");
menu.AddItem("f_bbs2","html","+","无忧脚本","f_bbs","");
menu.AddItem("f_bbs3","html","+","CSDN专家门诊","f_bbs","");
menu.AddItem("f_bbs4","html","+","洪恩在线网上交流","f_bbs","http://");
menu.AddExtendMenu("f_webpage","folder","16","网页制作","fav",null);
menu.AddItem("f_webpage1","html","","font disabled(空)/font","f_webpage","http://");
menu.AddExtendMenu("f_study","folder","16","网上学习","fav",null);
menu.AddItem("f_s1","html","","font disabled(空)/font","f_study","");
menu.AddExtendMenu("f_link","folder","16","友情链接","fav",null);
menu.AddItem("f_link1","html","+","无忧视窗","f_link","");
menu.AddExtendMenu("setting","start_set","24","设置font class=w2kfont(uS/u)/font","rbpm",null);
menu.AddItem("s_panel","folder","+","控制面板(C)","setting","http://");
menu.AddItem("sperator","","","","setting",null);
menu.AddItem("s_data","s_user","+","用户资料(D)","setting","http://");
menu.AddItem("s_display1","s_taskbar","+","任务栏和开始菜单(T)","setting","http://");
menu.AddExtendMenu("find","start_find","24","查找font class=w2kfont(uF/u)","rbpm",null);
menu.AddItem("l_search","search","4","文件或文件夹上(uF/u)...","find","http://");
menu.AddItem("i_search","esearch","4","在Internet上(uI/u)...","find","http://");
menu.AddItem("u_search","f_user","4","用户(uP/u)...","find","http://");
menu.AddItem("help","start_help","V"," 帮助font class=w2kfont(uH/u)/font","rbpm",null);
menu.AddItem("sperator","","","","rbpm",null);
menu.AddItem("logoff","start_logoff","v"," 注销font class=w2kfont(uL/u)/font","rbpm",null);
menu.AddItem("shut","start_shut","x","退出font class=w2kfont(uU/u)/font","rbpm",null);
document.writeln(menu.GetMenu());
--
/SCRIPT
/TD/TR/TABLE
我用dreamweaver8.0设计CSS样式按F12居然没有任何效果
在编辑区右键或者文本菜单里,选css样式-新建样式表,然后弹出新建css规则的对话框,选择你需要的选择器类型,命名,确定。进入css规则定义对话框,设置自己的需要,保存。还可以打开保存好的css样式在上面添加定义规则。
如何用Dreamweaver 8 创建css样式表代码
1、创建css样式,点击窗口\css样式,可以打开css样式编辑窗口,还可以直接在属性面板内创建。
2、点击属性面板的编辑规则,或者是css样式窗口的+号就可以打开新建css规则对话框。
3、选择要创建的css样式的内容。比如要为段落更改样式。
4、在弹出的定义对话框中,选择要更改的各种属性。比如把段落的字体大小改为16px,字体颜色改为红色。
5、点击确定,发现段落中的文字就出现了相应的效果。在head中条件了css样式代码。
请问单击右键出来的菜单是如何悬浮的?就是带有阴影效果的。是CSS做的吗?还是用什么整的?
JS做的,css稍微修改下样式而已!阴影效果可以用图片做,也可以用CSS滤镜做!
如何自定义web界面的右键菜单
在使用电脑的时候经常会用到右击鼠标菜单功能,背景是灰白色的很单调,其实菜单背景是可以更改的哦。下面就看看小编带来的如何美化和自定义鼠标右键菜单背景吧!
答案自然是肯定的!现在就教大家如何给你的电脑右键菜单添加自己喜欢的背景图片。
友情提示:本案例适用全部32位和部分64位的Win7、Win8、Win8.1、Vista和XP系统。
自定义右键菜单背景图片方法如下:
1、在魔方电脑大师的功能大全选项卡中,选择魔方美化大师。
2、在魔方美化大师中,在“系统外观设置”中选择“右键菜单背景”功能。如下图所示,直接点击打开右键菜单背景功能。
3、浏览选择自己喜欢的右键菜单背景图片,然后点击应用到系统按钮(注意:选择的图片大小应与右键菜单相符,否则容易出现背景图重叠或显示不全等问题)!
4、保存到系统中,魔方电脑大师设置的自定义右键背景图片就成功完成了。现在在电脑桌面点击鼠标右键,就可以看到弹出的右键菜单,有了养眼的背景图片。
▲注意事项
▲注意图片大小,不要过大,也不要过小,尤其是宽度。
▲如果想要取消鼠标右键背景图片,可以在魔方电脑大师中,直接选择“恢复到系统默认”按钮。
以上就是今天跟大家分享的“Win7系统如何美化和自定义鼠标右键菜单背景?”的全部内容,更多精彩内容请继续关注!
DW中如何快速找到CSS类别
DW中快速找到CSS类别步骤:
需要将css样式的这个窗口打开,然后你在DW的边界上就能看到这个css的窗口,如图:
然后这些显示出来的css中右键,有个菜单选择转到代码,就调到了指定的代码区域
新闻名称:css右键菜单样式,css左侧菜单栏
转载来源:http://cdiso.cn/article/phhigc.html