This article mainly introduces javascript code for implementing two-level navigation menu effects with rounded corners, involving javascript mouse events and dynamic conversion of page element styles, which is of great practical value, for more information about how to use JavaScript to implement the two-level navigation menu with rounded corners, see the example below. Share it with you for your reference. The details are as follows:
This is a menu with rounded corners made by
The daily required Tab plug-in of Bootstrap. You can use this plug-in to place the content on a Tab, capsule Tab, or even a drop-down menu Tab, if you are interested, you can refer to tabs. By combining some data attributes, you can easily create a Tab page.
"If you want to independently reference the plug-in function, you need to reference tab. js. Alternatively, as mentioned in the Bootstrap plug-in overview chapter, you can reference bootstrap.
I. Methods of UseSince Textures.js is based on d3.js, d3.js files must be introduced and textures.min.js files introduced.Second, HTML structureThe HTML structure of the SVG pattern background is very simple, using an empty div element.Third, JavaScriptThe attr property selects the element to make the pattern background and sets its width and height through the properties of the property:var svg = d3.select
Use PHP + JS to implement automatic search prompts (instances ). I think it is necessary for me to write this tutorial, because most of the applications I have seen about automatic completion only give you a program source code package and then tell you how to use it, instead of telling me that I think it is necessary to write this tutorial, because most of the a
events. # # #如何用leaflet快速加载地图
Introducing CSS Filesrel= "stylesheet" href= "http://cdn.leafletjs.com/leaflet-0.7.3/ Leaflet.css "/>Reference JavaScriptsrc= "Http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"> Script >Page to add a div container as a mapid= "Map">div>Determine the height of the map container#map {height:180px;}
# # # #设置地图 Set the map center and zoom level var map = l.map (' map '). Setview ([51.505, -0.09], +); Add layer l.tilelayer (' http://{s}.tiles.mapbox.com/v
the state of execution, and with this, writing a generator can implement functionality that requires an object-oriented implementation. For example, use an object to save the state, so write:var fib = { a: 0, b: 1, n: 0, max: 5, next: function () { var r = this.a, t = this.a + this.b; this.a = this.b; this.b = t; if (this.n this.max) { this.n ++; return r; } else { return undefined; } }};It is quite tedious to use the properties of the object to save the state.Another great benefit
A lot of webmaster reaction to open the site when there is a http://discuz.gtimg.cn/cloud/scripts/discuz_tips.js?v=1 has been loading, resulting in a slow Web page open, this time you can follow this tutorial to modify the file resolution:Note: This modification involves the modification of the source code, may be invalid after the upgrade, please decide whether to use this tutorialModified files: source/function/function_core.phpOpen File:Found itif
For more information about how to use jsdatetime, see.
The Code is as follows:
// Convert a Date string such as "10:18:30" to a Date objectVar strArray = str. split ("");Var strDate = strArray [0]. split ("-");Var strTime = strArray [1]. split (":");Var a = new Date (strDate [0], (strDate [1]-parseInt (1), strDate [2], strTime [0], strTime [1], strTime [2])
2: The second method is really simple.
Var s = "09:41:30 ";
Var d = new Date (Date. parse (s. replace (/-/g ,"/")));
-------------------
ument. getElementById (); obtain the html element in the subwindow object
2) reference the parent window in the Child Window
Code in the subwindow:
Using metadata opener.doc ument. getElementById (); obtain the html element in the parent window
Window. opener: refers to the reference to the parent window object of the current window, indicating the window object of the parent window
# P # php tutorial-javascript programming-bom in
JavaScript: several methods for JS to obtain HTML elements in a webpage. Javascript tutorial
GetElementById getElementsByName getElementsByTagName
GetElementById, getElementsByName, getElementsByTagName
The last two are the collection, and the byid is only a single object.
GetElementById usage
For example:
Taoba
Reference Method on the same page:
1. Use id:
Link1.href, return a http://homepage.yesky.com
2
[Js master path] html5 canvas animation tutorial,
In the previous section, we talked about constant motion, and the motion shared in this section is even more interesting:
Acceleration
Gravity Acceleration
Parabolic motion
Friction
Acceleration:
1
Acceleration decomposition and Synthesis
1
Parabolic motion:
1
Gravity bounce:
1
Parabolic and gravity bounce
1
Friction Motion
1
JS BasicsGrammar' Use strict ' (strict mode)Defining variablesvar object; Declare unassigned only, default value is undefined;var object1= value; Declare and assign value;function Fun (a) {This is also called a local variablevar obj=[] This is called a local variable and cannot be called in the outer body of the functionObjct1=[] is called a global variable, which can be used when the function name is called once.}Multi-variable definitionvar a,b,cx=1
The JS keyboard control event tutorial obtains keyboard control events, which is one of the most interactive methods. The first thing you need to know is how to initialize the event. The basic statement is as follows: document. onkeydown = keydown when the browser reads this statement, it calls the keydown () function no matter which key is pressed on the keyboard. Capturing Keyboard Events is a little diff
As we all know, jQuery is now very popular, and jQuery has already been used on Baidu's new homepage. Today we will summarize how to write better jQuery code to make jQuery Code better and faster to execute, I hope this jQuery tutorial will change your previous unreasonable practices.
1. Correctly reference jQuery1. Try to introduce jQuery before the body ends, rather than in the head.2. Use a third-party CDN to introduce jQuery. Note that when a pro
I. Methods of UseThe HTML structure of the canvas plugin is very simple, which is to use a tag:You can then invoke the plug-in using the following method:function init () {document.getElementById (' Portrait-image '). Closepixelate ([{resolution:24},{shape: ' Circle ', resolution:24, Size:16, Offset:12, alpha:0.5}]);};Window.addeventlistener (' Load ', init, false);Second, the structure function and the methodvar Img=document.getelementbyid (' portrait-img ');var mypixelation=new closepixelatio
Original addressWe learned about the creation of maps and markers in the front. So today we're going to learn how to display a window on a map (Infowindow)The Infowindow constructor is:Infowindow (opts?:infowindowoptions). The infowindowoptions Object Specifies the initialization parameters that are used to display the information window. Infowindowoptions Object Properties:content: contains a text string or displays a DOM node in the Information window. Pixeloffset: represents the position offs
cookies httpOnly .HistoryhistoryThe object holds the browser's history, and JavaScript can invoke the history object back() or the forward () user clicks the browser's back or forward button.This object belongs to the historical legacy, and for modern web pages, a simple and brutal invocation can be very annoying to users because of the large use of Ajax and page interactions history.back() .When a novice starts designing a Web page, he likes to call when the login page is successful history.ba
Transferred from: http://blog.csdn.net/lulei9876/article/details/8494337When self-study jquery, saw an English word (Callback), immediately back faint cold sweat. Google quickly found that the original Chinese translation into a callback. That is, the callback function. Do not understand Ah, so in the Google callback function, found that the online Chinese interpretation is too "abstruse", I admit that I caishuxueqian. After looking at some examples of callbacks, it seems a bit understandable. H
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.