当前位置: 首页>>代码示例>>C#>>正文


C# HTMLDocument.createElement方法代码示例

本文整理汇总了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();
        }
开发者ID:grefly,项目名称:Buy4,代码行数:27,代码来源:SlideTickScript.cs

示例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";
        }
开发者ID:grefly,项目名称:Buy4,代码行数:7,代码来源:VBScriptNode.cs

示例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";
        }
开发者ID:grefly,项目名称:Buy4,代码行数:10,代码来源:DeclineHyperlink.cs

示例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";
        }
开发者ID:grefly,项目名称:Buy4,代码行数:11,代码来源:AcceptHyperlink.cs

示例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";
        }
开发者ID:grefly,项目名称:Buy4,代码行数:12,代码来源:YesLink.cs

示例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();
        }
开发者ID:grefly,项目名称:Buy4,代码行数:13,代码来源:AcceptLinkClickScript.cs

示例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;
        }
开发者ID:grefly,项目名称:Buy4,代码行数:13,代码来源:DisplayDivFactory.cs

示例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();
        }
开发者ID:grefly,项目名称:Buy4,代码行数:14,代码来源:DeclineLinkClickScript.cs

示例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;
        }
开发者ID:grefly,项目名称:Buy4,代码行数:14,代码来源:NoticeDiv.cs

示例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();
        }
开发者ID:grefly,项目名称:Buy4,代码行数:18,代码来源:Buy4CustomJavaScript.cs

示例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();
        }
开发者ID:grefly,项目名称:Buy4,代码行数:18,代码来源:SlideUpScript.cs

示例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();
        }
开发者ID:grefly,项目名称:Buy4,代码行数:21,代码来源:GetCookieScript.cs

示例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();
        }
开发者ID:grefly,项目名称:Buy4,代码行数:21,代码来源:StartSlideScript.cs

示例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";
        }
开发者ID:grefly,项目名称:Buy4,代码行数:23,代码来源:SetCookieCacheScript.cs

示例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();
        }
开发者ID:grefly,项目名称:Buy4,代码行数:24,代码来源:EndSlideScript.cs


注:本文中的HTMLDocument.createElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。