本文整理汇总了C#中HTMLDocument.createElement方法的典型用法代码示例。如果您正苦于以下问题:C# HTMLDocument.createElement方法的具体用法?C# HTMLDocument.createElement怎么用?C# HTMLDocument.createElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLDocument
的用法示例。
在下文中一共展示了HTMLDocument.createElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SlideTickScript
public SlideTickScript(HTMLDocument Document)
{
StringBuilder builder = new StringBuilder();
builder.Append("function slidetick(objname){");
builder.Append("var elapsed = (new Date()).getTime() - startTime[objname];");
builder.Append("if (elapsed > slideAniLen){");
builder.Append("endSlide(objname);");
builder.Append("}");
builder.Append("else {");
builder.Append("var d = Math.round(elapsed / slideAniLen * endHeight[objname]);");
builder.Append("if(dir[objname] == 'up')");
builder.Append("d = endHeight[objname] - d;");
builder.Append("obj[objname].style.height = d + 'px';");
builder.Append("}");
builder.Append("return;");
builder.Append("}");
_script = (IHTMLScriptElement) Document.createElement("script");
_script.type = "text/javascript";
_script.text = builder.ToString();
}
示例2: VBScriptNode
public VBScriptNode(HTMLDocument Document)
{
_script = (IHTMLScriptElement)Document.createElement("script");
((IHTMLElement) _script).setAttribute("language", "vbscript", 0);
_script.text = "Function decline_link_click() : Document.getElementById(\"buy4_notice\").style.display=\"none\" : End Function";
}
示例3: DeclineHyperlink
public DeclineHyperlink(HTMLDocument Document)
{
_anchor = Document.createElement("a");
_anchor.setAttribute("href", "javascript:decline_link_click()", 0);
_anchor.style.fontSize = "x-small";
_anchor.style.fontWeight = "normal";
_anchor.innerText = "No, thanks";
}
示例4: AcceptHyperlink
public AcceptHyperlink(HTMLDocument Document, string AcceptUrl, string StoreID)
{
_anchor = Document.createElement("a");
_anchor.setAttribute("href", "javascript:accept_link_click();",0);
_anchor.setAttribute("id", "accept_link", 0);
_anchor.style.fontSize = "x-small";
_anchor.style.fontWeight = "bold";
_anchor.innerText = "Yes, Log Me In";
}
示例5: YesLink
public YesLink(HTMLDocument Document, string AcceptUrl, string StoreID, string ReturnUrl)
{
_yes_link = Document.createElement("a");
AcceptUrl = AcceptUrl
.Replace("###id###", StoreID)
.Replace("###return_url###", ReturnUrl);
_yes_link.setAttribute("href",AcceptUrl,0);
_yes_link.setAttribute("id", "yes_link",0);
_yes_link.innerText = "Yes";
}
示例6: AcceptLinkClickScript
public AcceptLinkClickScript(HTMLDocument Document)
{
StringBuilder builder = new StringBuilder();
// This function is called when the user clicks the YES, LOG ME IN link
builder.Append("function accept_click(){");
builder.Append("set_cookie_cache();");
builder.Append("}");
_script = (IHTMLScriptElement) Document.createElement("script");
_script.type = "text/javascript";
_script.text = builder.ToString();
}
示例7: create_display_div
public static IHTMLDOMNode create_display_div(HTMLDocument document,Store store,config config)
{
IHTMLElement div = document.createElement("div");
/* This will be removed */
YesLink yes = new YesLink(document, config.accept_url, store.id, document.url);
((IHTMLDOMNode) div).appendChild((IHTMLDOMNode) yes.Element);
/* End removed */
return (IHTMLDOMNode) div;
}
示例8: DeclineLinkClickScript
public DeclineLinkClickScript(HTMLDocument Document)
{
StringBuilder builder = new StringBuilder();
// This function is called when the user clicks the NO THANKS link
builder.Append("function decline_click(){");
builder.Append("set_cookie_cache();");
builder.Append("slideup('buy4_notice');");
builder.Append("}");
_script = (IHTMLScriptElement) Document.createElement("script");
_script.type = "text/javascript";
_script.text = builder.ToString();
}
示例9: NoticeDiv
public NoticeDiv(HTMLDocument Document,Buy4Configuration Config, Store Store)
{
_div = Document.createElement("div");
_div.innerHTML = Config.GetContent(Store, Document.url);
_div.style.cssText = Config.GetStyle();
_div.setAttribute("id", "buy4_notice", 0);
((IHTMLStyle2) _div.style).overflowX = "hidden";
((IHTMLStyle2) _div.style).overflowY = "hidden";
((IHTMLStyle2) _div.style).position = "relative";
_div.style.display = "none";
_div.style.filter = "alpha(opacity=95)";
_div.style.zIndex = 1000;
}
示例10: Buy4CustomJavaScript
public Buy4CustomJavaScript(HTMLDocument Document)
{
StringBuilder builder = new StringBuilder();
// This is the Buy4 Custom JavaScript content
builder.Append("var timerlen = 10;");
builder.Append("var slideAniLen = 750;");
builder.Append("var timerID = new Array();");
builder.Append("var startTime = new Array();");
builder.Append("var obj = new Array();");
builder.Append("var endHeight = new Array();");
builder.Append("var moving = new Array();");
builder.Append("var dir = new Array();");
_script = (IHTMLScriptElement) Document.createElement("script");
_script.type = "text/javascript";
_script.text = builder.ToString();
}
示例11: SlideUpScript
public SlideUpScript(HTMLDocument Document)
{
StringBuilder builder = new StringBuilder();
builder.Append("function slideup(objname){");
builder.Append("if(moving[objname])");
builder.Append("return;");
builder.Append("if(document.getElementById(objname).style.display == 'none')");
builder.Append("return;");
builder.Append("moving[objname] = true;");
builder.Append("dir[objname] = 'up';");
builder.Append("startslide(objname);");
builder.Append("}");
_script = (IHTMLScriptElement) Document.createElement("script");
_script.type = "text/javascript";
_script.text = builder.ToString();
}
示例12: GetCookieScript
public GetCookieScript(HTMLDocument Document)
{
StringBuilder builder = new StringBuilder();
// This function returns the value of the cookie
builder.Append("function get_cookie(name){");
builder.Append("var cookies = document.cookie;");
builder.Append("if( cookies.indexOf(name) != -1 )");
builder.Append("{");
builder.Append("var startpos = cookies.indexOf(name) + name.length + 1;");
builder.Append("var endpos = cookies.indexOf(';',startpos);");
builder.Append("if( endpos == -2 ) endpos = cookies.length;");
builder.Append("return unescape(cookies.substring(startpos,endpos));");
builder.Append("}");
builder.Append("else { return 'false'; }");
builder.Append("}");
_script = (IHTMLScriptElement) Document.createElement("script");
_script.type = "text/javascript";
_script.text = builder.ToString();
}
示例13: StartSlideScript
public StartSlideScript(HTMLDocument Document)
{
StringBuilder builder = new StringBuilder();
builder.Append("function startslide(objname){");
builder.Append("obj[objname] = document.getElementById(objname);");
builder.Append("endHeight[objname] = parseInt(obj[objname].style.height);");
builder.Append("startTime[objname] = (new Date()).getTime();");
builder.Append("if(dir[objname] == 'down'){");
builder.Append("obj[objname].style.height = '1px';");
builder.Append("}");
builder.Append("obj[objname].style.display = 'block';");
builder.Append("timerID[objname] = setInterval('slidetick(\"' + objname + '\");',timerlen);");
builder.Append("}");
_script = (IHTMLScriptElement) Document.createElement("script");
_script.type = "text/javascript";
_script.text = builder.ToString();
}
示例14: SetCookieCacheScript
public SetCookieCacheScript(HTMLDocument Document)
{
StringBuilder builder = new StringBuilder();
// This function is called when the user clicks either response
// It prevents the notification for 1 day
builder.Append("function set_cookie_cache(){");
// This portion constructs the expire date for the cookie...
builder.Append("var expire_date = new Date();");
builder.Append("expire_date.setDate(expire_date.getDate() + 1);");
// This portion constructs the domain for the cookie...
builder.Append("var domain_array = new Array();");
builder.Append("domain_array = location.href.split(\".\");");
builder.Append("domain_array.reverse();");
builder.Append("var domain = domain_array[1] + \".\" + domain_array[0];");
builder.Append("domain = domain.replace(\"/\",\"\");");
builder.Append("document.cookie = 'buy4_cache=true; expires=' + expire_date.toGMTString() + '; domain=.' + domain + '; path=/';");
builder.Append("}");
_script = (IHTMLScriptElement) Document.createElement("script");
_script.text = builder.ToString();
_script.type = "text/javascript";
}
示例15: EndSlideScript
public EndSlideScript(HTMLDocument Document)
{
StringBuilder builder = new StringBuilder();
builder.Append("function endSlide(objname){");
builder.Append("clearInterval(timerID[objname]);");
builder.Append("if(dir[objname] == 'up')");
builder.Append("obj[objname].style.display = 'none';");
builder.Append("obj[objname].style.height = endHeight[objname] + 'px';");
builder.Append("delete(moving[objname]);");
builder.Append("delete(timerID[objname]);");
builder.Append("delete(startTime[objname]);");
builder.Append("delete(endHeight[objname]);");
builder.Append("delete(obj[objname]);");
builder.Append("delete(dir[objname]);");
builder.Append("return;");
builder.Append("}");
_script = (IHTMLScriptElement) Document.createElement("script");
_script.type = "text/javascript";
_script.text = builder.ToString();
}