Today, we want to share an accordion image based on jquery. This image shows the effect of the mouse is gray before the mouse, when the picture becomes large and color. As follows:Online preview Source DownloadThe implemented code.HTML code: Divclass= "Page-container"> Divclass= "Flex-container"> Divclass= "Country Netherlands"> Div>NetherlandsDiv> Div> Divclass= "Country Belgium">
I know that most front-end developers are now using third-party libraries such as jquery to develop, which not only saves time, but also increases efficiency and makes the company more effective, why not?However, this will also have some shortcomings, such as JQ than JS slow, especially in large projects will appear, below I use native JS to achieve a simple accordion effect effect.The HTML code is as followsStructure is very simple 5 li box, JS code
Main Page code (found the bootstrap official online accordion instance style has the problem, here still uses the 3.0.~ version)DOCTYPE HTML>HTMLNg-app= "ct">HeadLang= "en"> MetaCharSet= "UTF-8"> title>title> Linkrel= "stylesheet"href= "Bootstrap-3.3.4-dist/css/bootstrap.css"/> Linkrel= "stylesheet"href= "Bootstrap-3.3.4-dist/css/bootstrap-r.css"/>Head>Body>HR>Divclass= "Container"Ng-controller= "C1"> Kittencup-group> Kittencup-c
This article mainly introduces how to implement the accordion menu based on Jquery code. the code is simple and easy to understand. For more information, see:
First look at the page code, nesting of the list:
B
C
C
C
B
C
C
C
B
C
C
When the mouse hover over the element or move out, you can use the hover method of jquery to bind the elements two processing methods, the former for mouse hover, the latter for the mouse to move out, so according to this feature and then set the corresponding elements of the CSS properties can be easily implemented accordion layout, but there is a problem, That is, the content is hidden when the mouse is moved out, the sample code is as follows:Title
Today, let's talk about Accordion in jquery ui. This function is mainly used to achieve the folding effect. It is suitable for menus and the commonly used Accordion... Let's take a look at our results:
If the drag function is missing, there will be nothing special about our work today. Here, we have introduced the jquery ui sortable, so that I can move the module up and down, the interaction is relativel
Js implements a foldable and expanded accordion menu.
This article describes how to implement a foldable and expanded accordion menu in js. Share it with you for your reference. The details are as follows:
This is a foldable and expanded menu. It uses CSS and JavaScript technology to combine and stretch webpage menus. The code is concise, and it is a work of code from foreigners. I hope you will like it.
Th
The Accordion retractable panel component, based on the panel, has the following examples:Click here to download the source codeJQuery Easy UI Accordion (retractable panel) component
jquery realization with glass streamer texture of the accordion effect is a JQUERY+CSS3 based on the realization of the glass streamer texture of the accordion effect, to share with you, specific as follows
Effect Chart:
The specific code is as follows:
HTML code:
JS code:
var Expand = function () {var tile = $ ('. Strips__strip ');
var Tilelink = $ ('. Strips__strip > S
This example describes the jquery Implementation expandable Accordion Panel menu. Share to everyone for your reference. Specifically as follows:
This is a common folding menu, accordion folding panel, will expand and close, with a point flash animation effect, modify the note:
Slideup: Dynamically hides all matching elements by changing height (decrease up), optionally triggering a callback function after
For you to explain the jquery animation special effects for the accordion, nonsense not to say, first look at the final implementation of the effect of the picture.
First, the realization principle analysis
The corresponding stereo diagram:
Second, HTML code analysis
1. The div with ID container is the red area in the analysis above.2. The UL with ID content is used to store all li.
3. Each li is a combination of a red area and
This article describes the JS implementation of the Imitation QQ Panel accordion effect folding menu code. Share to everyone for your reference. Specifically as follows:
This is a simple and practical vertical navigation menu, some people call this style "accordion" menu, similar to imitation QQ Panel folding menu, mouse on any menu, it will expand the level two menu, very good choice, previously shared su
Ext.onready (function () {var _panel = new Ext.panel ({Title: "Personnel Information",RenderTo:Ext.getBody (),Frame:true,WIDTH:500,HEIGHT:300,Layout: "Accordion",Layoutconfig: {Animate:true},Items:[{title: "Child element 1", HTML: "This is the contents of child element 1"},{title: "Child element 2", HTML: "This is the contents of child element 2"},{title: "Child element 3", HTML: "This is the contents of child element 3"}]});
The
Achieve resultsImplementation steps
Mouse into Li, the box becomes wider, the other boxes become narrower, the mouse moves away from the large box and reverts to the originalImplementation steps1. Add a background to Li2. Bind the onmouseover event, mouse into Li, the box becomes wider, the other box narrows3. Remove the box and return to the original
Implementation code "Front-end" javascript+jquery for accordion-style scroll
'). Slidetoggle ();
});
$ (". Childrenli"). Click (Function (event) {
event.stoppropagation ();
$ (". Childrenli"). Removeclass (' Selectedchildrenmenu ');
$ (". Parentli"). Removeclass (' Selectedparentmenu ');
$ (this). Parents (". Parentli"). AddClass (' Selectedparentmenu ');
$ (this). addclass (' Selectedchildrenmenu ');
});
It should be noted that the list nesting, will cause event bubbling, so in the click of the submenu event to organize Bubbles, event.sto
The title is Angularjs and Bootstrap combined to achieve the accordion menu, in fact, is the use of the bootstrap style.
In the previous article to introduce the angular.js and bootstrap combined implementation of the table pagination code. Then learn to implement the demo.
The main practice of custom instructions, to pass parameters to the instructions, the usual first effect chart:
Above is my custom instruction, the menu exists th
Do the accordion effect as follows, specific look at the code:HTML code
Copy Code code as follows:
var heads = Document.queryselectorall (". First-level");
function Headclick (event) {
var target = Eventutil.gettarget (event);
Toggledisplay (Target.parentNode.querySelector ("ul"));
}
for (Var i=0;iEventutil.addhandler (Heads[i], "click", Headclick);
}
Window.onunload = function () {
for (Var i=0;iEventutil.removehandler (Head
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.