Jquery sliding door implementation

Source: Internet
Author: User

Jquery sliding door implementation

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 


Jquery can also make a JS sliding door effect.

First define a div to hide the display of the div none
After all ('your div'}.click(('hidden div'}.css ({'display': 'block', 'top': 'This. top + 10 '}))
It is mainly to define a div so that his postion is an absolute position, and then hide it. The div is displayed after it is clicked. When it is moved to the corresponding position, it only needs to be hidden and set back to none.

[View the figure and answer] How to Implement AJAX | JQUERY | HTML | CSS | sliding door | tab | Dynamic Loading

Well, I think lz is complicated.

Indeed, the three option cards have no content during the first loading. When each tab is clicked for the first time, ajax is used to obtain the panel content.

Of course, each station has its own practice. If it is mine, I will do this.

Define an object variable on this page. The data is returned in json format (in fact, it is related to strings)

When you click tab, check whether the variable has been assigned a value.

If yes, load the panel content directly.

If no, ajax request data is performed.

I don't think it is necessary to determine whether the Panel contains rice or rice. The panel content is cleared every time the Panel content is loaded.

If you want to execute an ajax request, you just need to check that there is no such data in the memory.

I hope it will help you

Last, Merry Christmas

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.