jquery does lots now
This commit is contained in:
parent
ab7c62515e
commit
bb49c09279
@ -43,9 +43,8 @@ $(document).ready(function() {
|
|||||||
var sections=get_sections();
|
var sections=get_sections();
|
||||||
for(var i=0;i<sections.length;i++) toggle(sections[i]);
|
for(var i=0;i<sections.length;i++) toggle(sections[i]);
|
||||||
|
|
||||||
initGray("search_input", "Search");
|
$("#commentBox").DefaultValue("Comment");
|
||||||
initGray("commentBox", "Comment");
|
$("#tagBox").DefaultValue("tagme");
|
||||||
initGray("tagBox", "tagme");
|
|
||||||
|
|
||||||
// if we're going to show with JS, hide with JS first
|
// if we're going to show with JS, hide with JS first
|
||||||
pass_confirm = byId("pass_confirm");
|
pass_confirm = byId("pass_confirm");
|
||||||
@ -54,41 +53,6 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function initGray(boxname, text) {
|
|
||||||
var box = byId(boxname);
|
|
||||||
if(!box) return;
|
|
||||||
|
|
||||||
var clr = function () {cleargray(box, text);};
|
|
||||||
var set = function () {setgray(box, text);};
|
|
||||||
|
|
||||||
addEvent(box, "focus", clr, false);
|
|
||||||
addEvent(box, "blur", set, false);
|
|
||||||
|
|
||||||
if(box.value == text) {
|
|
||||||
box.style.color = "#999";
|
|
||||||
box.style.textAlign = "center";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
box.style.color = "#000";
|
|
||||||
box.style.textAlign = "left";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function cleargray(box, text) {
|
|
||||||
if(box.value == text) {
|
|
||||||
box.value = "";
|
|
||||||
box.style.color = "#000";
|
|
||||||
box.style.textAlign = "left";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function setgray(box, text) {
|
|
||||||
if(box.value == "") {
|
|
||||||
box.style.textAlign = "center";
|
|
||||||
box.style.color = "gray";
|
|
||||||
box.value = text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function showUp(elem) {
|
function showUp(elem) {
|
||||||
e = document.getElementById(elem)
|
e = document.getElementById(elem)
|
||||||
if(!e) return;
|
if(!e) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user