This article describes the toolbar that is related to menu design.
The menu described in the previous article has actually included the toolbar, but not the background can not be seen.
Add a bit of background and a little more actual functionality as
Figure 1: The light gray is the tool bar, Apple browser in full screen, the Address bar and toolbar is hidden, the mouse to the top of the screen is displayed. The toolbars you design should also be hidden when you don't need them.
Mouse over the toolbar in the blue "big font" point, change the font, the menu on the blue "big font" automatically become "small font, the body immediately becomes a small font." 2
Figure 2: The toolbar is missing and the font size becomes smaller. Because the text (fiction) is paginated, the scroll bar is not used (keep the screen neat).
Figure 3: The top right corner of the browser, click the transform Size, small screen display. Click "Reference translation" to load the target file, and a small window showing the reference translation of any paragraph in the body.
Y
The toolbar and menu implementation process is as follows:
First, add some content between the previous <style></style>:
. playmd{font-size:14px;height:25px;width:1024px;position:fixed; left:0px; Top:0px;background: #ddd; z-index:1;}
Then add the following <body>:
<div class= "Playmd" id= "Playmd" >
<ss> Documents </ss><ss> Chapters </ss><ss> reference translation </ss>
<input id= "BT1" type= "button" value= "Refresh"/>
<ss> font </ss><select id= "fnt" size=1 onchange= "GetStyle ()" >
</div>
The menus and toolbars are roughly the way they appear.
function implementation process:
$ ("Ss:eq (1)"). Live ("Click", Function () {//SS:EQ (1) indicates that the SS menu (blue font) starts from left to right 0. such as EQ (1) is the "chapter" menu name.
CheckPage ();
$ ("#chaptMenu"). Show ();
$ ("#chaptMenu Li"). Show ();
});
$ ("Ss:eq (2)"). Live ("Click", Function () {
Ileft.location=chinesef;
});
$ ("Ss:eq (3)"). Live ("Click", Function () {
if ($ ("Ss:eq (3)"). Text () = = "Medium Font") {
GetElement ("Div1"). style.fontsize= "19PX";
GetElement ("Div2"). style.fontsize= "19PX";
$ ("Ss:eq (3)"). Text ("large font");
}
else if ($ ("Ss:eq (3)"). Text () = = "Large Font") {
GetElement ("Div1"). style.fontsize= "14px";
GetElement ("Div2"). style.fontsize= "14px";
$ ("Ss:eq (3)"). Text ("small font");
}
else if ($ ("Ss:eq (3)"). Text () = = "Small font") {
GetElement ("Div1"). style.fontsize= "17PX";
GetElement ("Div2"). style.fontsize= "17PX";
$ ("Ss:eq (3)"). Text ("Medium font");
}
});
Toolbar Hide Implementation:
$ ("Body"). MouseMove (function (e) {//= It is displayed if the mouse is less than (near the toolbar position).
var Positiony=e.pagey,positionx=e.pagex;
if (Positiony <50) {
$ (". Playmd"). Show ();
}
else {
$ (". Playmd"). Hide ();
}
});
The size window transforms the implementation process:
$ (window). Resize (function () {
Initialize (); Initialize functions based on changing data (requires writing, i.e. a few lines of code)
ShowPage (); The function that displays the body;
});
Isn't it simple?