我正在构建我的新主题,我有一个问题。我使用jQuery显示输入的标签后输入:WordPress的内联标签(jQuery)
this.label2value = function(){
var inactive = "inactive";
var active = "active";
var focused = "focused";
$("label").each(function(){
obj = document.getElementById($(this).attr("for"));
if(($(obj).attr("type") == "text") || (obj.tagName.toLowerCase() == "textarea")){
$(obj).addClass(inactive);
var text = $(this).text();
$(this).css("display","none");
$(obj).val(text);
$(obj).focus(function(){
$(this).addClass(focused);
$(this).removeClass(inactive);
$(this).removeClass(active);
if($(this).val() == text) $(this).val("");
});
$(obj).blur(function(){
$(this).removeClass(focused);
if($(this).val() == "") {
$(this).val(text);
$(this).addClass(inactive);
} else {
$(this).addClass(active);
};
});
};
});
};
$(document).ready(function(){
label2value();
});
但是,问题是,当我提交通讯,如果不是一个网站的网址WP使用标签作为一个URL(http://YourWebsiteURL)。
我该如何解决这个问题?
就像透明BG的想法。谢谢。 – Axiol 2009-12-21 23:27:13