I wrote this article a few days ago.ArticleAll the functions mentioned are based on the services provided by dict.cn. The website dict.cn was accidentally discovered and feels very good. The use of Ajax technology can be said to be pure. I also like his entire operation model very much. It is a typical application of LIBA in Web 2.0. You can check it out if you have time. Www.dict.cn
Let's take a look at the daily oral function on my blog (pinzui.blogcns.com). It is actually very simple to implement this function, that is, to draw a div on the homepage, then we can put the script that shows the daily spoken language from dict.cn on it. Of course, the only thing worth noting is the DIV priority, because if the custom div is overwritten by the above Div if its priority is not specified, it cannot be displayed. BelowCodePut it in the Custom CSS module of the blog garden background.
# Topdictcn{Position:Absolute;Font-size:12px;Left:200px;Top:96px;Z-Index:100;}
The above layer Z-index is defined as one hundred, so that he can be at the top, and then add the following code in the header HTML code.
< Div ID = "Topdictcn" > < Span ID = "Dict_daily" > < A Href = "Http://dict.cn /" Target ="_ Blank" > Dict. cn </ A > </ Span > < Script Language = "JavaScript" SRC = Http://dict.cn/daily.php" Defer = "Defer" > </ Script > </ Div >
Next, let's take a look at how to add the word translation function, which is actually very simple. Add the following code
<Script SRC=Http://dict.cn/hc" Type="Text/JavaScript"></Script><Script Type="Text/JavaScript">Dictinit ();</Script>
You can also add a word translation switch, and add the following code to the desired position.
<Span ID="Dict_status"></Span>
The specific effect can be seen on my blog. I didn't enable the word translation function, because my blog is all in Chinese, and it seems to be a bit redundant to start word translation.