Today, a previously written mobile project, mainly about masking layer application, and incidentally mention some of the mobile development of things. First click on the pop-up mask layer This everyone is very familiar with, here or to provide you with a code, with the general not much difference, mainly talk about the method:
$ (function () {
var jiage=$ (". Jiage"), xingji=$ (". Xingji"), fj=$ (". FJ Li"), qd=$ (". QD");
Jiage.click (function () {
Tanchu ();
Xingji.slidedown (260);
});
function Tanchu () {
var w=document.createelement ("div");
W.setattribute ("id", "mybody"); Create a transparent background layer (MYBODY)
With (W.style) {
Width= ' 100% ';
height= ' 100% '
Position = ' absolute ';
ZIndex = ' 10 ';
left = ' 0 ';
top = ' 0 ';
Background = ' #000000 ';
Filter = ' Alpha ' (opacity=50);
opacity = ' 0.3 ';
}
Document.body.appendChild (w);
}
Fj.click (function () {
FJ.CSS ("Background", "#fff"). CSS ("Box-shadow", "0"). CSS ("Color", "#000");
$ (this). CSS ("Background", "#F4F4F4"). CSS ("Box-shadow", "0px 1px 0px #999 inset"). CSS ("Color", "#31A1A4");
});
Clear Mask Layer after click
Qd.click (function () {
Xingji.slideup (300);
var m=$ ("#mybody");
M.remove ();
});
});
Masking layer code Nothing to say, JQ Basic DOM operation, of course, it is necessary to pick up, but also easy to read. It is also worth mentioning that the mask layer of the pop-up window should be careful to destroy, and here because there is a definite option on the page, so by clicking OK after the clear mask layer. Of course, here's a way to do a pull-up box on the mobile side. I use the pull-up box first with the absolute positioning of the fixed, and then click on the time to pull down, because its own JQ slideup to take the div from 0 to big, so this approach can achieve the effect we want. Attached sheet:
Here to mention that the project was previously done in small companies outsourcing projects, initially only achieved the effect, and the user experience is actually very poor, the browser to take the same effect as the client obviously has a large defect, slow reaction. Of course, in a way, debugging can also improve a part of the effect.
JS mask layer and the pull-up box on the mobile side