script
-
The difference between javascript execution before and after elements When writing native js, we found that the script cannot be executed before the dom element, and it needs to be placed after the dom element to be effective. Because the js is executed immediately after loading, we put the code in the window.onload function body, and let the page be loaded completely before execution. Window. onload=function() {//Execute when the page is loaded} The jQuery code placed before and after the page element has no impact on the execution effect two thousand and nineteen five thousand and sixty -
JQuery implements the effect of mouse sliding delay display Web developers sometimes use delayed user interaction events, such as the product display on the home page of JumeiYoupin website. When the mouse moves into the product for one second, the product details will be displayed, instead of the user's mouse pointer just moving into the element to display the details. For users who do not want to display details, it achieves friendly interaction, Next, we will use jQuery's timer setTimeout two thousand and thirteen nineteen thousand and twenty-three -
Jquery determines the browser type Using jquery to determine the browser needs to use the syntax: $. browser ['Browser keyword '] Judge the syntax example of each browser two thousand and thirteen ten thousand four hundred and seventeen -
Iframe adaptive height method I haven't updated my blog for a long time. Due to the busy work, the team of the small editor came up with the problem of iframe adaptive height when making zblog topics. Now I share it with you. I hope it can help you. Many students who are exposed to the WEB front end have been troubled by the adaptive height of iframe. Today, Tuoyuan shares the method of adaptive height of iframe. The width of iframe is 300px by default, and the height is 150px by default. If you need to adapt the height, you need to use the following two thousand and thirteen seventeen thousand nine hundred and twenty-five -
CSS Hack of IE10 Just now I saw the CSSHack method of IE10 on the Internet, and found that IE10 browser no longer supports conditional annotation. So I used IE10 browser to visit some projects I had done before, and found no exceptions. PS: The project seldom uses conditional annotation, which is nothing more than transparent style compatible with IE6. PNG images used by IE7+are transparent, so it doesn't matter if IE10 doesn't support conditional annotation two thousand and thirteen eleven thousand eight hundred and eighty-three -
Set as the code of home page and favorite site, compatible with IE, chrome, firefox I believe many friends are looking for the codes of "set as home page" and "collect this site". Now there are many codes on the Internet, but the compatibility is not very good. Let's share these two codes with good compatibility, which are also used in some topics of Tuoyuan. I hope it can save your time. Why write if you can use them directly two thousand and twelve twenty-two thousand five hundred and nine -
Intelligent floating layer positioning solution When the page scrolls and the smart floating layer begins to fade out of the browser window, it floats on the top edge of the browser window. This effect is common on major websites in China, such as Sina Weibo and Taobao. Implementation principle: The default state is the default state, and you don't need to do anything. It's OK to locate it as absolute or static two thousand and twelve twelve thousand two hundred and eleven -
Move the mouse over the link to change the color continuously I found a very interesting website design on the Internet today. The mouse will keep changing color on the link. So as a lazy person, I found several scripts on the Internet that the mouse moved to the link and kept changing color. Now I share them with you. I hope you can brainstorm and apply them to your website two thousand and twelve seven thousand six hundred and sixteen -
Add cloud input method for your Zblog (QQ, Sogou, Baidu) I accidentally found that many websites have cloud input method in their comment boxes. So I went to various cloud input method websites and added a cloud input method button to the comment box of Tuoyuan. Add an input method button on the website. There are detailed instructions on the website. Click to start the cloud input method. Code example: QQ cloud input method icon: (This icon is generated and processed by the ICO plug-in of photoshop software. Photoshop installed this plug-in can support opening and saving in ICO format. Friends who need this plug-in can click here two thousand and twelve eight thousand six hundred and thirty-four -
Method of removing the dotted line of the link 1. Directly add onfocus="this. blur()" two thousand and eleven seven thousand three hundred and fifty -
IE6 does not support li: hover IE6 is not compatible with li: hover. I read many similar articles on the Internet and used many methods but failed. Later, I found a solution that is compatible with IE6/IE7/IE8 and Firefox two thousand and eleven eleven thousand five hundred and twenty-nine -
HTML Button.onclick Event Summary HTMLButton.onclick Event Summary two thousand and eleven seven thousand two hundred and forty-five -
Js implementation of imitating Sina Weibo back to the top In the web page, if the page is high, in order to facilitate the user to quickly return to the top, a return to top button will be added. On Taobao, the back to top button is displayed only when the scroll distance of the scroll bar is greater than a certain distance; The return top of Renren is directly on the toolbar at the bottom; The return top of Sina Weibo is displayed when the rolling height is greater than 0, and the return top effect is a smooth animation effect. The realization of this article is similar to the effect of Sina Weibo. Sina Weibo has launched a new domain name weibo.com two thousand and eleven eight thousand four hundred and eighty -
Fourteen Writing Skills of JS Write any programming code, different developers will have different views. But it's always good to refer. Here are 14 best JS code writing tips from Javascript Toolbox. 1. Always use var. In javascript, variables are either global or functional. Using the var keyword will be the key to keep variables simple and clear two thousand and eleven seven thousand eight hundred and eighty-seven -
CSS Implementation of Table Interlaced Color Change CSS implements table interlaced color change. The sheep led by the lion will always defeat the lion led by the sheep! Rise in distress, decline in happiness. The coffee pot is filled with ups and downs, and the coffee cup is filled with dreams. Feel the warmth of the winter sun, as if I were by your side. Use an optimistic attitude to interpret the world! When you cry because you don't have shoes, you will look up and see someone without feet. Keep smiling, be happy and inspire others. Keep smiling, maybe you can make yourself really two thousand and eleven seven thousand six hundred and twenty-four -
Js implements the deletion confirmation dialog box Js implements the delete confirmation dialog box. The code is as follows: two thousand and eleven eight thousand and seventy-four -
JS drop-down menu How Javascript implements the secondary menu two thousand and eleven thirteen thousand five hundred and seventy-five -
9 common mistakes in CSS layout For beginners, there must be many problems. Of course, there are also many problems. Here are some common mistakes and simple ways to eliminate them: 1. Check whether there are spelling errors in HTML elements and whether you forget the end tag. Even seasoned people often mistake the nesting relationship of divs. You can use dreamweaver's verification function to check for errors. 2. Check whether the CSS is written correctly. Check whether there are spelling errors and whether the ending} is forgotten two thousand and eleven five thousand nine hundred and eighty-four