Quick AJAX loading of tabs using JQuery (example) _ jquery-js tutorial

Source: Internet
Author: User
This article mainly introduces how to use JQuery to quickly implement AJAX dynamic loading of tabs (for example ). The implementation process is as follows:

1. Find the link source. Here is a string of links under Li.

2. Processing styles

3. When the mouse moves, load the website of The Link source to the specified container, and switch the style so that the Click Event returns false. The link source webpage should not be clicked here.

5. Over.

Script:

The Code is as follows:


{
// HomeNews
Var tid = "# homeNews"; // removeTabBold
Var lvTabs =$ (tid );
If (lvTabs! = Null)
{
LvTabs. find (""). each (function () {$ (this ). click (function () {return false ;}); $ (this ). mouseover (function (){
RemoveTabBold (tid); $ (this). addClass ("bold ");
$ (This). parent (). addClass ("lvbg ");
$ ('# HomeNewsList'). load ($ (this). href ());
Return false ;})});
}
}
Function removeTabBold (LvTabId)
{

$ (LvTabId). find ("a"). each (function (){
$ (This). removeClass ("bold ");
$ (This). parent (). removeClass ("lvbg ");
$ (This). parent (). removeClass ("lvp ");});
}

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.